00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef SWSCALE_SWSCALE_INTERNAL_H
00022 #define SWSCALE_SWSCALE_INTERNAL_H
00023
00024 #include "config.h"
00025
00026 #if HAVE_ALTIVEC_H
00027 #include <altivec.h>
00028 #endif
00029
00030 #include "libavutil/avassert.h"
00031 #include "libavutil/avutil.h"
00032 #include "libavutil/common.h"
00033 #include "libavutil/intreadwrite.h"
00034 #include "libavutil/log.h"
00035 #include "libavutil/pixfmt.h"
00036 #include "libavutil/pixdesc.h"
00037
00038 #define STR(s) AV_TOSTRING(s) // AV_STRINGIFY is too long
00039
00040 #define YUVRGB_TABLE_HEADROOM 128
00041
00042 #define FAST_BGR2YV12 // use 7-bit instead of 15-bit coefficients
00043
00044 #define MAX_FILTER_SIZE 256
00045
00046 #define DITHER1XBPP
00047
00048 #if HAVE_BIGENDIAN
00049 #define ALT32_CORR (-1)
00050 #else
00051 #define ALT32_CORR 1
00052 #endif
00053
00054 #if ARCH_X86_64
00055 # define APCK_PTR2 8
00056 # define APCK_COEF 16
00057 # define APCK_SIZE 24
00058 #else
00059 # define APCK_PTR2 4
00060 # define APCK_COEF 8
00061 # define APCK_SIZE 16
00062 #endif
00063
00064 struct SwsContext;
00065
00066 typedef int (*SwsFunc)(struct SwsContext *context, const uint8_t *src[],
00067 int srcStride[], int srcSliceY, int srcSliceH,
00068 uint8_t *dst[], int dstStride[]);
00069
00082 typedef void (*yuv2planar1_fn)(const int16_t *src, uint8_t *dest, int dstW,
00083 const uint8_t *dither, int offset);
00084
00098 typedef void (*yuv2planarX_fn)(const int16_t *filter, int filterSize,
00099 const int16_t **src, uint8_t *dest, int dstW,
00100 const uint8_t *dither, int offset);
00101
00117 typedef void (*yuv2interleavedX_fn)(struct SwsContext *c,
00118 const int16_t *chrFilter,
00119 int chrFilterSize,
00120 const int16_t **chrUSrc,
00121 const int16_t **chrVSrc,
00122 uint8_t *dest, int dstW);
00123
00153 typedef void (*yuv2packed1_fn)(struct SwsContext *c, const int16_t *lumSrc,
00154 const int16_t *chrUSrc[2],
00155 const int16_t *chrVSrc[2],
00156 const int16_t *alpSrc, uint8_t *dest,
00157 int dstW, int uvalpha, int y);
00186 typedef void (*yuv2packed2_fn)(struct SwsContext *c, const int16_t *lumSrc[2],
00187 const int16_t *chrUSrc[2],
00188 const int16_t *chrVSrc[2],
00189 const int16_t *alpSrc[2],
00190 uint8_t *dest,
00191 int dstW, int yalpha, int uvalpha, int y);
00218 typedef void (*yuv2packedX_fn)(struct SwsContext *c, const int16_t *lumFilter,
00219 const int16_t **lumSrc, int lumFilterSize,
00220 const int16_t *chrFilter,
00221 const int16_t **chrUSrc,
00222 const int16_t **chrVSrc, int chrFilterSize,
00223 const int16_t **alpSrc, uint8_t *dest,
00224 int dstW, int y);
00225
00226
00227 typedef struct SwsContext {
00231 const AVClass *av_class;
00232
00237 SwsFunc swScale;
00238 int srcW;
00239 int srcH;
00240 int dstH;
00241 int chrSrcW;
00242 int chrSrcH;
00243 int chrDstW;
00244 int chrDstH;
00245 int lumXInc, chrXInc;
00246 int lumYInc, chrYInc;
00247 enum AVPixelFormat dstFormat;
00248 enum AVPixelFormat srcFormat;
00249 int dstFormatBpp;
00250 int srcFormatBpp;
00251 int dstBpc, srcBpc;
00252 int chrSrcHSubSample;
00253 int chrSrcVSubSample;
00254 int chrDstHSubSample;
00255 int chrDstVSubSample;
00256 int vChrDrop;
00257 int sliceDir;
00258 double param[2];
00259
00260 uint32_t pal_yuv[256];
00261 uint32_t pal_rgb[256];
00262
00273 int16_t **lumPixBuf;
00274 int16_t **chrUPixBuf;
00275 int16_t **chrVPixBuf;
00276 int16_t **alpPixBuf;
00277 int vLumBufSize;
00278 int vChrBufSize;
00279 int lastInLumBuf;
00280 int lastInChrBuf;
00281 int lumBufIndex;
00282 int chrBufIndex;
00283
00284
00285 uint8_t *formatConvBuffer;
00286
00301 int16_t *hLumFilter;
00302 int16_t *hChrFilter;
00303 int16_t *vLumFilter;
00304 int16_t *vChrFilter;
00305 int32_t *hLumFilterPos;
00306 int32_t *hChrFilterPos;
00307 int32_t *vLumFilterPos;
00308 int32_t *vChrFilterPos;
00309 int hLumFilterSize;
00310 int hChrFilterSize;
00311 int vLumFilterSize;
00312 int vChrFilterSize;
00313
00314
00315 int lumMmxextFilterCodeSize;
00316 int chrMmxextFilterCodeSize;
00317 uint8_t *lumMmxextFilterCode;
00318 uint8_t *chrMmxextFilterCode;
00319
00320 int canMMXEXTBeUsed;
00321
00322 int dstY;
00323 int flags;
00324 void *yuvTable;
00325 uint8_t *table_rV[256 + 2*YUVRGB_TABLE_HEADROOM];
00326 uint8_t *table_gU[256 + 2*YUVRGB_TABLE_HEADROOM];
00327 int table_gV[256 + 2*YUVRGB_TABLE_HEADROOM];
00328 uint8_t *table_bU[256 + 2*YUVRGB_TABLE_HEADROOM];
00329
00330
00331 int contrast, brightness, saturation;
00332 int srcColorspaceTable[4];
00333 int dstColorspaceTable[4];
00334 int srcRange;
00335 int dstRange;
00336 int src0Alpha;
00337 int dst0Alpha;
00338 int yuv2rgb_y_offset;
00339 int yuv2rgb_y_coeff;
00340 int yuv2rgb_v2r_coeff;
00341 int yuv2rgb_v2g_coeff;
00342 int yuv2rgb_u2g_coeff;
00343 int yuv2rgb_u2b_coeff;
00344
00345 #define RED_DITHER "0*8"
00346 #define GREEN_DITHER "1*8"
00347 #define BLUE_DITHER "2*8"
00348 #define Y_COEFF "3*8"
00349 #define VR_COEFF "4*8"
00350 #define UB_COEFF "5*8"
00351 #define VG_COEFF "6*8"
00352 #define UG_COEFF "7*8"
00353 #define Y_OFFSET "8*8"
00354 #define U_OFFSET "9*8"
00355 #define V_OFFSET "10*8"
00356 #define LUM_MMX_FILTER_OFFSET "11*8"
00357 #define CHR_MMX_FILTER_OFFSET "11*8+4*4*256"
00358 #define DSTW_OFFSET "11*8+4*4*256*2" //do not change, it is hardcoded in the ASM
00359 #define ESP_OFFSET "11*8+4*4*256*2+8"
00360 #define VROUNDER_OFFSET "11*8+4*4*256*2+16"
00361 #define U_TEMP "11*8+4*4*256*2+24"
00362 #define V_TEMP "11*8+4*4*256*2+32"
00363 #define Y_TEMP "11*8+4*4*256*2+40"
00364 #define ALP_MMX_FILTER_OFFSET "11*8+4*4*256*2+48"
00365 #define UV_OFF_PX "11*8+4*4*256*3+48"
00366 #define UV_OFF_BYTE "11*8+4*4*256*3+56"
00367 #define DITHER16 "11*8+4*4*256*3+64"
00368 #define DITHER32 "11*8+4*4*256*3+80"
00369
00370 DECLARE_ALIGNED(8, uint64_t, redDither);
00371 DECLARE_ALIGNED(8, uint64_t, greenDither);
00372 DECLARE_ALIGNED(8, uint64_t, blueDither);
00373
00374 DECLARE_ALIGNED(8, uint64_t, yCoeff);
00375 DECLARE_ALIGNED(8, uint64_t, vrCoeff);
00376 DECLARE_ALIGNED(8, uint64_t, ubCoeff);
00377 DECLARE_ALIGNED(8, uint64_t, vgCoeff);
00378 DECLARE_ALIGNED(8, uint64_t, ugCoeff);
00379 DECLARE_ALIGNED(8, uint64_t, yOffset);
00380 DECLARE_ALIGNED(8, uint64_t, uOffset);
00381 DECLARE_ALIGNED(8, uint64_t, vOffset);
00382 int32_t lumMmxFilter[4 * MAX_FILTER_SIZE];
00383 int32_t chrMmxFilter[4 * MAX_FILTER_SIZE];
00384 int dstW;
00385 DECLARE_ALIGNED(8, uint64_t, esp);
00386 DECLARE_ALIGNED(8, uint64_t, vRounder);
00387 DECLARE_ALIGNED(8, uint64_t, u_temp);
00388 DECLARE_ALIGNED(8, uint64_t, v_temp);
00389 DECLARE_ALIGNED(8, uint64_t, y_temp);
00390 int32_t alpMmxFilter[4 * MAX_FILTER_SIZE];
00391
00392
00393
00394 DECLARE_ALIGNED(8, ptrdiff_t, uv_off);
00395 DECLARE_ALIGNED(8, ptrdiff_t, uv_offx2);
00396 DECLARE_ALIGNED(8, uint16_t, dither16)[8];
00397 DECLARE_ALIGNED(8, uint32_t, dither32)[8];
00398
00399 const uint8_t *chrDither8, *lumDither8;
00400
00401 #if HAVE_ALTIVEC
00402 vector signed short CY;
00403 vector signed short CRV;
00404 vector signed short CBU;
00405 vector signed short CGU;
00406 vector signed short CGV;
00407 vector signed short OY;
00408 vector unsigned short CSHIFT;
00409 vector signed short *vYCoeffsBank, *vCCoeffsBank;
00410 #endif
00411
00412 #if ARCH_BFIN
00413 DECLARE_ALIGNED(4, uint32_t, oy);
00414 DECLARE_ALIGNED(4, uint32_t, oc);
00415 DECLARE_ALIGNED(4, uint32_t, zero);
00416 DECLARE_ALIGNED(4, uint32_t, cy);
00417 DECLARE_ALIGNED(4, uint32_t, crv);
00418 DECLARE_ALIGNED(4, uint32_t, rmask);
00419 DECLARE_ALIGNED(4, uint32_t, cbu);
00420 DECLARE_ALIGNED(4, uint32_t, bmask);
00421 DECLARE_ALIGNED(4, uint32_t, cgu);
00422 DECLARE_ALIGNED(4, uint32_t, cgv);
00423 DECLARE_ALIGNED(4, uint32_t, gmask);
00424 #endif
00425
00426 #if HAVE_VIS
00427 DECLARE_ALIGNED(8, uint64_t, sparc_coeffs)[10];
00428 #endif
00429 int use_mmx_vfilter;
00430
00431
00432 yuv2planar1_fn yuv2plane1;
00433 yuv2planarX_fn yuv2planeX;
00434 yuv2interleavedX_fn yuv2nv12cX;
00435 yuv2packed1_fn yuv2packed1;
00436 yuv2packed2_fn yuv2packed2;
00437 yuv2packedX_fn yuv2packedX;
00438
00440 void (*lumToYV12)(uint8_t *dst, const uint8_t *src, const uint8_t *src2, const uint8_t *src3,
00441 int width, uint32_t *pal);
00443 void (*alpToYV12)(uint8_t *dst, const uint8_t *src, const uint8_t *src2, const uint8_t *src3,
00444 int width, uint32_t *pal);
00446 void (*chrToYV12)(uint8_t *dstU, uint8_t *dstV,
00447 const uint8_t *src1, const uint8_t *src2, const uint8_t *src3,
00448 int width, uint32_t *pal);
00449
00455 void (*readLumPlanar)(uint8_t *dst, const uint8_t *src[4], int width);
00456 void (*readChrPlanar)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src[4],
00457 int width);
00479 void (*hyscale_fast)(struct SwsContext *c,
00480 int16_t *dst, int dstWidth,
00481 const uint8_t *src, int srcW, int xInc);
00482 void (*hcscale_fast)(struct SwsContext *c,
00483 int16_t *dst1, int16_t *dst2, int dstWidth,
00484 const uint8_t *src1, const uint8_t *src2,
00485 int srcW, int xInc);
00519 void (*hyScale)(struct SwsContext *c, int16_t *dst, int dstW,
00520 const uint8_t *src, const int16_t *filter,
00521 const int32_t *filterPos, int filterSize);
00522 void (*hcScale)(struct SwsContext *c, int16_t *dst, int dstW,
00523 const uint8_t *src, const int16_t *filter,
00524 const int32_t *filterPos, int filterSize);
00527
00528 void (*lumConvertRange)(int16_t *dst, int width);
00530 void (*chrConvertRange)(int16_t *dst1, int16_t *dst2, int width);
00531
00532 int needs_hcscale;
00533 } SwsContext;
00534
00535
00536 SwsFunc ff_yuv2rgb_get_func_ptr(SwsContext *c);
00537 int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4],
00538 int fullRange, int brightness,
00539 int contrast, int saturation);
00540
00541 void ff_yuv2rgb_init_tables_altivec(SwsContext *c, const int inv_table[4],
00542 int brightness, int contrast, int saturation);
00543 void updateMMXDitherTables(SwsContext *c, int dstY, int lumBufIndex, int chrBufIndex,
00544 int lastInLumBuf, int lastInChrBuf);
00545
00546 SwsFunc ff_yuv2rgb_init_mmx(SwsContext *c);
00547 SwsFunc ff_yuv2rgb_init_vis(SwsContext *c);
00548 SwsFunc ff_yuv2rgb_init_altivec(SwsContext *c);
00549 SwsFunc ff_yuv2rgb_get_func_ptr_bfin(SwsContext *c);
00550 void ff_bfin_get_unscaled_swscale(SwsContext *c);
00551
00552 #if FF_API_SWS_FORMAT_NAME
00553
00556 attribute_deprecated
00557 const char *sws_format_name(enum AVPixelFormat format);
00558 #endif
00559
00560 static av_always_inline int is16BPS(enum AVPixelFormat pix_fmt)
00561 {
00562 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
00563 av_assert0(desc);
00564 return desc->comp[0].depth_minus1 == 15;
00565 }
00566
00567 static av_always_inline int is9_OR_10BPS(enum AVPixelFormat pix_fmt)
00568 {
00569 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
00570 av_assert0(desc);
00571 return desc->comp[0].depth_minus1 >= 8 && desc->comp[0].depth_minus1 <= 13;
00572 }
00573
00574 #define isNBPS(x) is9_OR_10BPS(x)
00575
00576 static av_always_inline int isBE(enum AVPixelFormat pix_fmt)
00577 {
00578 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
00579 av_assert0(desc);
00580 return desc->flags & PIX_FMT_BE;
00581 }
00582
00583 static av_always_inline int isYUV(enum AVPixelFormat pix_fmt)
00584 {
00585 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
00586 av_assert0(desc);
00587 return !(desc->flags & PIX_FMT_RGB) && desc->nb_components >= 2;
00588 }
00589
00590 static av_always_inline int isPlanarYUV(enum AVPixelFormat pix_fmt)
00591 {
00592 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
00593 av_assert0(desc);
00594 return ((desc->flags & PIX_FMT_PLANAR) && isYUV(pix_fmt));
00595 }
00596
00597 static av_always_inline int isRGB(enum AVPixelFormat pix_fmt)
00598 {
00599 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
00600 av_assert0(desc);
00601 return (desc->flags & PIX_FMT_RGB);
00602 }
00603
00604 #if 0 // FIXME
00605 #define isGray(x) \
00606 (!(av_pix_fmt_desc_get(x)->flags & PIX_FMT_PAL) && \
00607 av_pix_fmt_desc_get(x)->nb_components <= 2)
00608 #else
00609 #define isGray(x) \
00610 ((x) == AV_PIX_FMT_GRAY8 || \
00611 (x) == AV_PIX_FMT_Y400A || \
00612 (x) == AV_PIX_FMT_GRAY16BE || \
00613 (x) == AV_PIX_FMT_GRAY16LE)
00614 #endif
00615
00616 #define isRGBinInt(x) \
00617 ( \
00618 (x) == AV_PIX_FMT_RGB48BE || \
00619 (x) == AV_PIX_FMT_RGB48LE || \
00620 (x) == AV_PIX_FMT_RGBA64BE || \
00621 (x) == AV_PIX_FMT_RGBA64LE || \
00622 (x) == AV_PIX_FMT_RGB32 || \
00623 (x) == AV_PIX_FMT_RGB32_1 || \
00624 (x) == AV_PIX_FMT_RGB24 || \
00625 (x) == AV_PIX_FMT_RGB565BE || \
00626 (x) == AV_PIX_FMT_RGB565LE || \
00627 (x) == AV_PIX_FMT_RGB555BE || \
00628 (x) == AV_PIX_FMT_RGB555LE || \
00629 (x) == AV_PIX_FMT_RGB444BE || \
00630 (x) == AV_PIX_FMT_RGB444LE || \
00631 (x) == AV_PIX_FMT_RGB8 || \
00632 (x) == AV_PIX_FMT_RGB4 || \
00633 (x) == AV_PIX_FMT_RGB4_BYTE || \
00634 (x) == AV_PIX_FMT_MONOBLACK || \
00635 (x) == AV_PIX_FMT_MONOWHITE \
00636 )
00637 #define isBGRinInt(x) \
00638 ( \
00639 (x) == AV_PIX_FMT_BGR48BE || \
00640 (x) == AV_PIX_FMT_BGR48LE || \
00641 (x) == AV_PIX_FMT_BGRA64BE || \
00642 (x) == AV_PIX_FMT_BGRA64LE || \
00643 (x) == AV_PIX_FMT_BGR32 || \
00644 (x) == AV_PIX_FMT_BGR32_1 || \
00645 (x) == AV_PIX_FMT_BGR24 || \
00646 (x) == AV_PIX_FMT_BGR565BE || \
00647 (x) == AV_PIX_FMT_BGR565LE || \
00648 (x) == AV_PIX_FMT_BGR555BE || \
00649 (x) == AV_PIX_FMT_BGR555LE || \
00650 (x) == AV_PIX_FMT_BGR444BE || \
00651 (x) == AV_PIX_FMT_BGR444LE || \
00652 (x) == AV_PIX_FMT_BGR8 || \
00653 (x) == AV_PIX_FMT_BGR4 || \
00654 (x) == AV_PIX_FMT_BGR4_BYTE || \
00655 (x) == AV_PIX_FMT_MONOBLACK || \
00656 (x) == AV_PIX_FMT_MONOWHITE \
00657 )
00658
00659 #define isRGBinBytes(x) ( \
00660 (x) == AV_PIX_FMT_RGB48BE \
00661 || (x) == AV_PIX_FMT_RGB48LE \
00662 || (x) == AV_PIX_FMT_RGBA64BE \
00663 || (x) == AV_PIX_FMT_RGBA64LE \
00664 || (x) == AV_PIX_FMT_RGBA \
00665 || (x) == AV_PIX_FMT_ARGB \
00666 || (x) == AV_PIX_FMT_RGB24 \
00667 )
00668 #define isBGRinBytes(x) ( \
00669 (x) == AV_PIX_FMT_BGR48BE \
00670 || (x) == AV_PIX_FMT_BGR48LE \
00671 || (x) == AV_PIX_FMT_BGRA64BE \
00672 || (x) == AV_PIX_FMT_BGRA64LE \
00673 || (x) == AV_PIX_FMT_BGRA \
00674 || (x) == AV_PIX_FMT_ABGR \
00675 || (x) == AV_PIX_FMT_BGR24 \
00676 )
00677
00678 #define isAnyRGB(x) \
00679 ( \
00680 isRGBinInt(x) || \
00681 isBGRinInt(x) || \
00682 (x)==AV_PIX_FMT_GBR24P \
00683 )
00684
00685 static av_always_inline int isALPHA(enum AVPixelFormat pix_fmt)
00686 {
00687 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
00688 av_assert0(desc);
00689 return desc->nb_components == 2 || desc->nb_components == 4;
00690 }
00691
00692 #if 1
00693 #define isPacked(x) ( \
00694 (x)==AV_PIX_FMT_PAL8 \
00695 || (x)==AV_PIX_FMT_YUYV422 \
00696 || (x)==AV_PIX_FMT_UYVY422 \
00697 || (x)==AV_PIX_FMT_Y400A \
00698 || isRGBinInt(x) \
00699 || isBGRinInt(x) \
00700 )
00701 #else
00702 static av_always_inline int isPacked(enum AVPixelFormat pix_fmt)
00703 {
00704 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
00705 av_assert0(desc);
00706 return ((desc->nb_components >= 2 && !(desc->flags & PIX_FMT_PLANAR)) ||
00707 pix_fmt == AV_PIX_FMT_PAL8);
00708 }
00709
00710 #endif
00711 static av_always_inline int isPlanar(enum AVPixelFormat pix_fmt)
00712 {
00713 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
00714 av_assert0(desc);
00715 return (desc->nb_components >= 2 && (desc->flags & PIX_FMT_PLANAR));
00716 }
00717
00718 static av_always_inline int isPackedRGB(enum AVPixelFormat pix_fmt)
00719 {
00720 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
00721 av_assert0(desc);
00722 return ((desc->flags & (PIX_FMT_PLANAR | PIX_FMT_RGB)) == PIX_FMT_RGB);
00723 }
00724
00725 static av_always_inline int isPlanarRGB(enum AVPixelFormat pix_fmt)
00726 {
00727 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
00728 av_assert0(desc);
00729 return ((desc->flags & (PIX_FMT_PLANAR | PIX_FMT_RGB)) ==
00730 (PIX_FMT_PLANAR | PIX_FMT_RGB));
00731 }
00732
00733 static av_always_inline int usePal(enum AVPixelFormat pix_fmt)
00734 {
00735 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
00736 av_assert0(desc);
00737 return (desc->flags & PIX_FMT_PAL) || (desc->flags & PIX_FMT_PSEUDOPAL);
00738 }
00739
00740 extern const uint64_t ff_dither4[2];
00741 extern const uint64_t ff_dither8[2];
00742 extern const uint8_t dithers[8][8][8];
00743 extern const uint16_t dither_scale[15][16];
00744
00745
00746 extern const AVClass sws_context_class;
00747
00752 void ff_get_unscaled_swscale(SwsContext *c);
00753
00754 void ff_swscale_get_unscaled_altivec(SwsContext *c);
00755
00760 SwsFunc ff_getSwsFunc(SwsContext *c);
00761
00762 void ff_sws_init_input_funcs(SwsContext *c);
00763 void ff_sws_init_output_funcs(SwsContext *c,
00764 yuv2planar1_fn *yuv2plane1,
00765 yuv2planarX_fn *yuv2planeX,
00766 yuv2interleavedX_fn *yuv2nv12cX,
00767 yuv2packed1_fn *yuv2packed1,
00768 yuv2packed2_fn *yuv2packed2,
00769 yuv2packedX_fn *yuv2packedX);
00770 void ff_sws_init_swScale_altivec(SwsContext *c);
00771 void ff_sws_init_swScale_mmx(SwsContext *c);
00772
00773 static inline void fillPlane16(uint8_t *plane, int stride, int width, int height, int y,
00774 int alpha, int bits, const int big_endian)
00775 {
00776 int i, j;
00777 uint8_t *ptr = plane + stride * y;
00778 int v = alpha ? 0xFFFF>>(15-bits) : (1<<bits);
00779 for (i = 0; i < height; i++) {
00780 #define FILL(wfunc) \
00781 for (j = 0; j < width; j++) {\
00782 wfunc(ptr+2*j, v);\
00783 }
00784 if (big_endian) {
00785 FILL(AV_WB16);
00786 } else {
00787 FILL(AV_WL16);
00788 }
00789 ptr += stride;
00790 }
00791 }
00792
00793 #endif