1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

Merge commit '1909f6b1b6da2db371c179bed5a19aaf979b7557'

* commit '1909f6b1b6da2db371c179bed5a19aaf979b7557':
  swscale: cosmetics: Drop silly camelCase from swScale function pointer name

Conflicts:
	libswscale/swscale_unscaled.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-08-29 15:54:14 +02:00
commit 01cac26f68
6 changed files with 37 additions and 37 deletions

View File

@ -77,11 +77,11 @@ av_cold void ff_get_unscaled_swscale_bfin(SwsContext *c)
if (c->dstFormat == AV_PIX_FMT_YUV420P && c->srcFormat == AV_PIX_FMT_UYVY422) { if (c->dstFormat == AV_PIX_FMT_YUV420P && c->srcFormat == AV_PIX_FMT_UYVY422) {
av_log(NULL, AV_LOG_VERBOSE, av_log(NULL, AV_LOG_VERBOSE,
"selecting Blackfin optimized uyvytoyv12_unscaled\n"); "selecting Blackfin optimized uyvytoyv12_unscaled\n");
c->swScale = uyvytoyv12_unscaled; c->swscale = uyvytoyv12_unscaled;
} }
if (c->dstFormat == AV_PIX_FMT_YUV420P && c->srcFormat == AV_PIX_FMT_YUYV422) { if (c->dstFormat == AV_PIX_FMT_YUV420P && c->srcFormat == AV_PIX_FMT_YUYV422) {
av_log(NULL, AV_LOG_VERBOSE, av_log(NULL, AV_LOG_VERBOSE,
"selecting Blackfin optimized yuyvtoyv12_unscaled\n"); "selecting Blackfin optimized yuyvtoyv12_unscaled\n");
c->swScale = yuyvtoyv12_unscaled; c->swscale = yuyvtoyv12_unscaled;
} }
} }

View File

@ -193,9 +193,9 @@ av_cold void ff_get_unscaled_swscale_ppc(SwsContext *c)
// unscaled YV12 -> packed YUV, we want speed // unscaled YV12 -> packed YUV, we want speed
if (dstFormat == AV_PIX_FMT_YUYV422) if (dstFormat == AV_PIX_FMT_YUYV422)
c->swScale = yv12toyuy2_unscaled_altivec; c->swscale = yv12toyuy2_unscaled_altivec;
else if (dstFormat == AV_PIX_FMT_UYVY422) else if (dstFormat == AV_PIX_FMT_UYVY422)
c->swScale = yv12touyvy_unscaled_altivec; c->swscale = yv12touyvy_unscaled_altivec;
} }
#endif /* HAVE_ALTIVEC */ #endif /* HAVE_ALTIVEC */
} }

View File

@ -331,7 +331,7 @@ static av_always_inline void hcscale(SwsContext *c, int16_t *dst1,
if (DEBUG_SWSCALE_BUFFERS) \ if (DEBUG_SWSCALE_BUFFERS) \
av_log(c, AV_LOG_DEBUG, __VA_ARGS__) av_log(c, AV_LOG_DEBUG, __VA_ARGS__)
static int swScale(SwsContext *c, const uint8_t *src[], static int swscale(SwsContext *c, const uint8_t *src[],
int srcStride[], int srcSliceY, int srcStride[], int srcSliceY,
int srcSliceH, uint8_t *dst[], int dstStride[]) int srcSliceH, uint8_t *dst[], int dstStride[])
{ {
@ -403,7 +403,7 @@ static int swScale(SwsContext *c, const uint8_t *src[],
srcStride[1] <<= c->vChrDrop; srcStride[1] <<= c->vChrDrop;
srcStride[2] <<= c->vChrDrop; srcStride[2] <<= c->vChrDrop;
DEBUG_BUFFERS("swScale() %p[%d] %p[%d] %p[%d] %p[%d] -> %p[%d] %p[%d] %p[%d] %p[%d]\n", DEBUG_BUFFERS("swscale() %p[%d] %p[%d] %p[%d] %p[%d] -> %p[%d] %p[%d] %p[%d] %p[%d]\n",
src[0], srcStride[0], src[1], srcStride[1], src[0], srcStride[0], src[1], srcStride[1],
src[2], srcStride[2], src[3], srcStride[3], src[2], srcStride[2], src[3], srcStride[3],
dst[0], dstStride[0], dst[1], dstStride[1], dst[0], dstStride[0], dst[1], dstStride[1],
@ -704,7 +704,7 @@ static int swScale(SwsContext *c, const uint8_t *src[],
return dstY - lastDstY; return dstY - lastDstY;
} }
static av_cold void sws_init_swScale_c(SwsContext *c) static av_cold void sws_init_swscale(SwsContext *c)
{ {
enum AVPixelFormat srcFormat = c->srcFormat; enum AVPixelFormat srcFormat = c->srcFormat;
@ -757,14 +757,14 @@ static av_cold void sws_init_swScale_c(SwsContext *c)
SwsFunc ff_getSwsFunc(SwsContext *c) SwsFunc ff_getSwsFunc(SwsContext *c)
{ {
sws_init_swScale_c(c); sws_init_swscale(c);
if (ARCH_PPC) if (ARCH_PPC)
ff_sws_init_swscale_ppc(c); ff_sws_init_swscale_ppc(c);
if (ARCH_X86) if (ARCH_X86)
ff_sws_init_swscale_x86(c); ff_sws_init_swscale_x86(c);
return swScale; return swscale;
} }
static void reset_ptr(const uint8_t *src[], int format) static void reset_ptr(const uint8_t *src[], int format)
@ -1072,7 +1072,7 @@ int attribute_align_arg sws_scale(struct SwsContext *c,
if (srcSliceY + srcSliceH == c->srcH) if (srcSliceY + srcSliceH == c->srcH)
c->sliceDir = 0; c->sliceDir = 0;
ret = c->swScale(c, src2, srcStride2, srcSliceY, srcSliceH, dst2, ret = c->swscale(c, src2, srcStride2, srcSliceY, srcSliceH, dst2,
dstStride2); dstStride2);
} else { } else {
// slices go from bottom to top => we flip the image internally // slices go from bottom to top => we flip the image internally
@ -1098,7 +1098,7 @@ int attribute_align_arg sws_scale(struct SwsContext *c,
if (!srcSliceY) if (!srcSliceY)
c->sliceDir = 0; c->sliceDir = 0;
ret = c->swScale(c, src2, srcStride2, c->srcH-srcSliceY-srcSliceH, ret = c->swscale(c, src2, srcStride2, c->srcH-srcSliceY-srcSliceH,
srcSliceH, dst2, dstStride2); srcSliceH, dst2, dstStride2);
} }

View File

@ -274,7 +274,7 @@ typedef struct SwsContext {
* Note that src, dst, srcStride, dstStride will be copied in the * Note that src, dst, srcStride, dstStride will be copied in the
* sws_scale() wrapper so they can be freely modified here. * sws_scale() wrapper so they can be freely modified here.
*/ */
SwsFunc swScale; SwsFunc swscale;
int srcW; ///< Width of source luma/alpha planes. int srcW; ///< Width of source luma/alpha planes.
int srcH; ///< Height of source luma/alpha planes. int srcH; ///< Height of source luma/alpha planes.
int dstH; ///< Height of destination luma/alpha planes. int dstH; ///< Height of destination luma/alpha planes.
@ -497,7 +497,7 @@ typedef struct SwsContext {
int16_t xyz2rgb_matrix[3][4]; int16_t xyz2rgb_matrix[3][4];
int16_t rgb2xyz_matrix[3][4]; int16_t rgb2xyz_matrix[3][4];
/* function pointers for swScale() */ /* function pointers for swscale() */
yuv2planar1_fn yuv2plane1; yuv2planar1_fn yuv2plane1;
yuv2planarX_fn yuv2planeX; yuv2planarX_fn yuv2planeX;
yuv2interleavedX_fn yuv2nv12cX; yuv2interleavedX_fn yuv2nv12cX;
@ -827,7 +827,7 @@ extern const int32_t ff_yuv2rgb_coeffs[8][4];
extern const AVClass sws_context_class; extern const AVClass sws_context_class;
/** /**
* Set c->swScale to an unscaled converter if one exists for the specific * Set c->swscale to an unscaled converter if one exists for the specific
* source and destination formats, bit depths, flags, etc. * source and destination formats, bit depths, flags, etc.
*/ */
void ff_get_unscaled_swscale(SwsContext *c); void ff_get_unscaled_swscale(SwsContext *c);

View File

@ -1175,35 +1175,35 @@ void ff_get_unscaled_swscale(SwsContext *c)
/* yv12_to_nv12 */ /* yv12_to_nv12 */
if ((srcFormat == AV_PIX_FMT_YUV420P || srcFormat == AV_PIX_FMT_YUVA420P) && if ((srcFormat == AV_PIX_FMT_YUV420P || srcFormat == AV_PIX_FMT_YUVA420P) &&
(dstFormat == AV_PIX_FMT_NV12 || dstFormat == AV_PIX_FMT_NV21)) { (dstFormat == AV_PIX_FMT_NV12 || dstFormat == AV_PIX_FMT_NV21)) {
c->swScale = planarToNv12Wrapper; c->swscale = planarToNv12Wrapper;
} }
/* yuv2bgr */ /* yuv2bgr */
if ((srcFormat == AV_PIX_FMT_YUV420P || srcFormat == AV_PIX_FMT_YUV422P || if ((srcFormat == AV_PIX_FMT_YUV420P || srcFormat == AV_PIX_FMT_YUV422P ||
srcFormat == AV_PIX_FMT_YUVA420P) && isAnyRGB(dstFormat) && srcFormat == AV_PIX_FMT_YUVA420P) && isAnyRGB(dstFormat) &&
!(flags & SWS_ACCURATE_RND) && (c->dither == SWS_DITHER_BAYER || c->dither == SWS_DITHER_AUTO) && !(dstH & 1)) { !(flags & SWS_ACCURATE_RND) && (c->dither == SWS_DITHER_BAYER || c->dither == SWS_DITHER_AUTO) && !(dstH & 1)) {
c->swScale = ff_yuv2rgb_get_func_ptr(c); c->swscale = ff_yuv2rgb_get_func_ptr(c);
} }
if (srcFormat == AV_PIX_FMT_YUV410P && if (srcFormat == AV_PIX_FMT_YUV410P &&
(dstFormat == AV_PIX_FMT_YUV420P || dstFormat == AV_PIX_FMT_YUVA420P) && (dstFormat == AV_PIX_FMT_YUV420P || dstFormat == AV_PIX_FMT_YUVA420P) &&
!(flags & SWS_BITEXACT)) { !(flags & SWS_BITEXACT)) {
c->swScale = yvu9ToYv12Wrapper; c->swscale = yvu9ToYv12Wrapper;
} }
/* bgr24toYV12 */ /* bgr24toYV12 */
if (srcFormat == AV_PIX_FMT_BGR24 && if (srcFormat == AV_PIX_FMT_BGR24 &&
(dstFormat == AV_PIX_FMT_YUV420P || dstFormat == AV_PIX_FMT_YUVA420P) && (dstFormat == AV_PIX_FMT_YUV420P || dstFormat == AV_PIX_FMT_YUVA420P) &&
!(flags & SWS_ACCURATE_RND)) !(flags & SWS_ACCURATE_RND))
c->swScale = bgr24ToYv12Wrapper; c->swscale = bgr24ToYv12Wrapper;
/* RGB/BGR -> RGB/BGR (no dither needed forms) */ /* RGB/BGR -> RGB/BGR (no dither needed forms) */
if (isAnyRGB(srcFormat) && isAnyRGB(dstFormat) && findRgbConvFn(c) if (isAnyRGB(srcFormat) && isAnyRGB(dstFormat) && findRgbConvFn(c)
&& (!needsDither || (c->flags&(SWS_FAST_BILINEAR|SWS_POINT)))) && (!needsDither || (c->flags&(SWS_FAST_BILINEAR|SWS_POINT))))
c->swScale= rgbToRgbWrapper; c->swscale = rgbToRgbWrapper;
if ((srcFormat == AV_PIX_FMT_GBRP && dstFormat == AV_PIX_FMT_GBRAP) || if ((srcFormat == AV_PIX_FMT_GBRP && dstFormat == AV_PIX_FMT_GBRAP) ||
(srcFormat == AV_PIX_FMT_GBRAP && dstFormat == AV_PIX_FMT_GBRP)) (srcFormat == AV_PIX_FMT_GBRAP && dstFormat == AV_PIX_FMT_GBRP))
c->swScale = planarRgbToplanarRgbWrapper; c->swscale = planarRgbToplanarRgbWrapper;
#define isByteRGB(f) ( \ #define isByteRGB(f) ( \
f == AV_PIX_FMT_RGB32 || \ f == AV_PIX_FMT_RGB32 || \
@ -1214,7 +1214,7 @@ void ff_get_unscaled_swscale(SwsContext *c)
f == AV_PIX_FMT_BGR24) f == AV_PIX_FMT_BGR24)
if (srcFormat == AV_PIX_FMT_GBRP && isPlanar(srcFormat) && isByteRGB(dstFormat)) if (srcFormat == AV_PIX_FMT_GBRP && isPlanar(srcFormat) && isByteRGB(dstFormat))
c->swScale = planarRgbToRgbWrapper; c->swscale = planarRgbToRgbWrapper;
if ((srcFormat == AV_PIX_FMT_GBRP9LE || srcFormat == AV_PIX_FMT_GBRP9BE || if ((srcFormat == AV_PIX_FMT_GBRP9LE || srcFormat == AV_PIX_FMT_GBRP9BE ||
srcFormat == AV_PIX_FMT_GBRP16LE || srcFormat == AV_PIX_FMT_GBRP16BE || srcFormat == AV_PIX_FMT_GBRP16LE || srcFormat == AV_PIX_FMT_GBRP16BE ||
@ -1225,11 +1225,11 @@ void ff_get_unscaled_swscale(SwsContext *c)
dstFormat == AV_PIX_FMT_BGR48LE || dstFormat == AV_PIX_FMT_BGR48BE || dstFormat == AV_PIX_FMT_BGR48LE || dstFormat == AV_PIX_FMT_BGR48BE ||
dstFormat == AV_PIX_FMT_RGBA64LE || dstFormat == AV_PIX_FMT_RGBA64BE || dstFormat == AV_PIX_FMT_RGBA64LE || dstFormat == AV_PIX_FMT_RGBA64BE ||
dstFormat == AV_PIX_FMT_BGRA64LE || dstFormat == AV_PIX_FMT_BGRA64BE)) dstFormat == AV_PIX_FMT_BGRA64LE || dstFormat == AV_PIX_FMT_BGRA64BE))
c->swScale = planarRgb16ToRgb16Wrapper; c->swscale = planarRgb16ToRgb16Wrapper;
if (av_pix_fmt_desc_get(srcFormat)->comp[0].depth_minus1 == 7 && if (av_pix_fmt_desc_get(srcFormat)->comp[0].depth_minus1 == 7 &&
isPackedRGB(srcFormat) && dstFormat == AV_PIX_FMT_GBRP) isPackedRGB(srcFormat) && dstFormat == AV_PIX_FMT_GBRP)
c->swScale = rgbToPlanarRgbWrapper; c->swscale = rgbToPlanarRgbWrapper;
/* bswap 16 bits per pixel/component packed formats */ /* bswap 16 bits per pixel/component packed formats */
if (IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_BGR444) || if (IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_BGR444) ||
@ -1265,16 +1265,16 @@ void ff_get_unscaled_swscale(SwsContext *c)
IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_YUV444P12) || IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_YUV444P12) ||
IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_YUV444P14) || IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_YUV444P14) ||
IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_YUV444P16)) IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_YUV444P16))
c->swScale = packed_16bpc_bswap; c->swscale = packed_16bpc_bswap;
if (usePal(srcFormat) && isByteRGB(dstFormat)) if (usePal(srcFormat) && isByteRGB(dstFormat))
c->swScale = palToRgbWrapper; c->swscale = palToRgbWrapper;
if (srcFormat == AV_PIX_FMT_YUV422P) { if (srcFormat == AV_PIX_FMT_YUV422P) {
if (dstFormat == AV_PIX_FMT_YUYV422) if (dstFormat == AV_PIX_FMT_YUYV422)
c->swScale = yuv422pToYuy2Wrapper; c->swscale = yuv422pToYuy2Wrapper;
else if (dstFormat == AV_PIX_FMT_UYVY422) else if (dstFormat == AV_PIX_FMT_UYVY422)
c->swScale = yuv422pToUyvyWrapper; c->swscale = yuv422pToUyvyWrapper;
} }
/* LQ converters if -sws 0 or -sws 4*/ /* LQ converters if -sws 0 or -sws 4*/
@ -1282,21 +1282,21 @@ void ff_get_unscaled_swscale(SwsContext *c)
/* yv12_to_yuy2 */ /* yv12_to_yuy2 */
if (srcFormat == AV_PIX_FMT_YUV420P || srcFormat == AV_PIX_FMT_YUVA420P) { if (srcFormat == AV_PIX_FMT_YUV420P || srcFormat == AV_PIX_FMT_YUVA420P) {
if (dstFormat == AV_PIX_FMT_YUYV422) if (dstFormat == AV_PIX_FMT_YUYV422)
c->swScale = planarToYuy2Wrapper; c->swscale = planarToYuy2Wrapper;
else if (dstFormat == AV_PIX_FMT_UYVY422) else if (dstFormat == AV_PIX_FMT_UYVY422)
c->swScale = planarToUyvyWrapper; c->swscale = planarToUyvyWrapper;
} }
} }
if (srcFormat == AV_PIX_FMT_YUYV422 && if (srcFormat == AV_PIX_FMT_YUYV422 &&
(dstFormat == AV_PIX_FMT_YUV420P || dstFormat == AV_PIX_FMT_YUVA420P)) (dstFormat == AV_PIX_FMT_YUV420P || dstFormat == AV_PIX_FMT_YUVA420P))
c->swScale = yuyvToYuv420Wrapper; c->swscale = yuyvToYuv420Wrapper;
if (srcFormat == AV_PIX_FMT_UYVY422 && if (srcFormat == AV_PIX_FMT_UYVY422 &&
(dstFormat == AV_PIX_FMT_YUV420P || dstFormat == AV_PIX_FMT_YUVA420P)) (dstFormat == AV_PIX_FMT_YUV420P || dstFormat == AV_PIX_FMT_YUVA420P))
c->swScale = uyvyToYuv420Wrapper; c->swscale = uyvyToYuv420Wrapper;
if (srcFormat == AV_PIX_FMT_YUYV422 && dstFormat == AV_PIX_FMT_YUV422P) if (srcFormat == AV_PIX_FMT_YUYV422 && dstFormat == AV_PIX_FMT_YUV422P)
c->swScale = yuyvToYuv422Wrapper; c->swscale = yuyvToYuv422Wrapper;
if (srcFormat == AV_PIX_FMT_UYVY422 && dstFormat == AV_PIX_FMT_YUV422P) if (srcFormat == AV_PIX_FMT_UYVY422 && dstFormat == AV_PIX_FMT_YUV422P)
c->swScale = uyvyToYuv422Wrapper; c->swscale = uyvyToYuv422Wrapper;
#define isPlanarGray(x) (isGray(x) && (x) != AV_PIX_FMT_GRAY8A) #define isPlanarGray(x) (isGray(x) && (x) != AV_PIX_FMT_GRAY8A)
/* simple copy */ /* simple copy */
@ -1313,9 +1313,9 @@ void ff_get_unscaled_swscale(SwsContext *c)
srcFormat != AV_PIX_FMT_NV12 && srcFormat != AV_PIX_FMT_NV21)) srcFormat != AV_PIX_FMT_NV12 && srcFormat != AV_PIX_FMT_NV21))
{ {
if (isPacked(c->srcFormat)) if (isPacked(c->srcFormat))
c->swScale = packedCopyWrapper; c->swscale = packedCopyWrapper;
else /* Planar YUV or gray */ else /* Planar YUV or gray */
c->swScale = planarCopyWrapper; c->swscale = planarCopyWrapper;
} }
if (ARCH_BFIN) if (ARCH_BFIN)

View File

@ -1292,7 +1292,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
(c->srcRange == c->dstRange || isAnyRGB(dstFormat))) { (c->srcRange == c->dstRange || isAnyRGB(dstFormat))) {
ff_get_unscaled_swscale(c); ff_get_unscaled_swscale(c);
if (c->swScale) { if (c->swscale) {
if (flags & SWS_PRINT_INFO) if (flags & SWS_PRINT_INFO)
av_log(c, AV_LOG_INFO, av_log(c, AV_LOG_INFO,
"using unscaled %s -> %s special converter\n", "using unscaled %s -> %s special converter\n",
@ -1606,7 +1606,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
c->chrXInc, c->chrYInc); c->chrXInc, c->chrYInc);
} }
c->swScale = ff_getSwsFunc(c); c->swscale = ff_getSwsFunc(c);
return 0; return 0;
fail: // FIXME replace things by appropriate error codes fail: // FIXME replace things by appropriate error codes
return -1; return -1;