mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-13 21:28:01 +02:00
Merge remote-tracking branch 'qatar/master'
* qatar/master: lavf: make compute_pkt_fields2() return meaningful error values matroskadec: set timestamps for RealAudio packets. intelh263dec: aspect ratio processing fix. intelh263dec: fix "Strict H.263 compliance" file playback oss,sndio: simplify by using FFMIN. swscale: extract monowhite/black output from yuv2packed[12X]_c(). swscale: de-macro'ify RGB15/16/32 input functions. swscale: rearrange code. movdec: Add support for the 'wfex' atom. ffmpeg.c: Add a necessary const qualifier riff: Fix potential memleak. swscale: change 48bit RGB input macros to inline functions. swscale: change 9/10bit YUV input macros to inline functions. swscale: extract gray16 output functions from yuv2packed[12X](). swscale: use standard clipping functions. swscale: merge macros that are used only once. swscale: fix function declarations in swscale.c. swscale: fix function declaration keywords in x86/swscale_template.c. Conflicts: ffmpeg.c libavcodec/intelh263dec.c libswscale/swscale.c libswscale/x86/swscale_template.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
2ec77aae67
@ -67,9 +67,9 @@ int ff_intel_h263_decode_picture_header(MpegEncContext *s)
|
||||
if (format < 6) {
|
||||
s->width = h263_format[format][0];
|
||||
s->height = h263_format[format][1];
|
||||
s->avctx->sample_aspect_ratio.num=12;s->avctx->sample_aspect_ratio.den=11;
|
||||
}
|
||||
else {
|
||||
s->avctx->sample_aspect_ratio.num = 12;
|
||||
s->avctx->sample_aspect_ratio.den = 11;
|
||||
} else {
|
||||
format = get_bits(&s->gb, 3);
|
||||
if(format == 0 || format == 7){
|
||||
av_log(s->avctx, AV_LOG_ERROR, "Wrong Intel H263 format\n");
|
||||
@ -95,12 +95,11 @@ int ff_intel_h263_decode_picture_header(MpegEncContext *s)
|
||||
if(ar == 15){
|
||||
s->avctx->sample_aspect_ratio.num = get_bits(&s->gb, 8); // aspect ratio - width
|
||||
s->avctx->sample_aspect_ratio.den = get_bits(&s->gb, 8); // aspect ratio - height
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
s->avctx->sample_aspect_ratio = ff_h263_pixel_aspect[ar];
|
||||
}
|
||||
if(s->avctx->sample_aspect_ratio.num == 0)
|
||||
av_log(s->avctx, AV_LOG_ERROR, "Invalid aspect ratio\n");
|
||||
if (s->avctx->sample_aspect_ratio.num == 0)
|
||||
av_log(s->avctx, AV_LOG_ERROR, "Invalid aspect ratio.\n");
|
||||
}
|
||||
|
||||
s->chroma_qscale= s->qscale = get_bits(&s->gb, 5);
|
||||
|
@ -513,6 +513,19 @@ static int mov_read_dac3(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int mov_read_wfex(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
||||
{
|
||||
AVStream *st;
|
||||
|
||||
if (c->fc->nb_streams < 1)
|
||||
return 0;
|
||||
st = c->fc->streams[c->fc->nb_streams-1];
|
||||
|
||||
ff_get_wav_header(pb, st->codec, atom.size);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int mov_read_pasp(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
||||
{
|
||||
const int num = avio_rb32(pb);
|
||||
@ -2261,6 +2274,7 @@ static const MOVParseTableEntry mov_default_parse_table[] = {
|
||||
{ MKTAG('e','s','d','s'), mov_read_esds },
|
||||
{ MKTAG('d','a','c','3'), mov_read_dac3 }, /* AC-3 info */
|
||||
{ MKTAG('w','i','d','e'), mov_read_wide }, /* place holder */
|
||||
{ MKTAG('w','f','e','x'), mov_read_wfex },
|
||||
{ MKTAG('c','m','o','v'), mov_read_cmov },
|
||||
{ MKTAG('c','h','a','n'), mov_read_chan },
|
||||
{ 0, NULL }
|
||||
|
@ -537,6 +537,7 @@ int ff_get_wav_header(AVIOContext *pb, AVCodecContext *codec, int size)
|
||||
}
|
||||
codec->extradata_size = cbSize;
|
||||
if (cbSize > 0) {
|
||||
av_free(codec->extradata);
|
||||
codec->extradata = av_mallocz(codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
if (!codec->extradata)
|
||||
return AVERROR(ENOMEM);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -77,13 +77,17 @@ const char *swscale_license(void)
|
||||
|| (x)==PIX_FMT_BGR48BE \
|
||||
|| (x)==PIX_FMT_BGR48LE \
|
||||
|| (x)==PIX_FMT_BGR24 \
|
||||
|| (x)==PIX_FMT_BGR565 \
|
||||
|| (x)==PIX_FMT_BGR555 \
|
||||
|| (x)==PIX_FMT_BGR565LE \
|
||||
|| (x)==PIX_FMT_BGR565BE \
|
||||
|| (x)==PIX_FMT_BGR555LE \
|
||||
|| (x)==PIX_FMT_BGR555BE \
|
||||
|| (x)==PIX_FMT_BGR32 \
|
||||
|| (x)==PIX_FMT_BGR32_1 \
|
||||
|| (x)==PIX_FMT_RGB24 \
|
||||
|| (x)==PIX_FMT_RGB565 \
|
||||
|| (x)==PIX_FMT_RGB555 \
|
||||
|| (x)==PIX_FMT_RGB565LE \
|
||||
|| (x)==PIX_FMT_RGB565BE \
|
||||
|| (x)==PIX_FMT_RGB555LE \
|
||||
|| (x)==PIX_FMT_RGB555BE \
|
||||
|| (x)==PIX_FMT_GRAY8 \
|
||||
|| (x)==PIX_FMT_GRAY8A \
|
||||
|| (x)==PIX_FMT_YUV410P \
|
||||
@ -137,7 +141,22 @@ int sws_isSupportedInput(enum PixelFormat pix_fmt)
|
||||
|| (x)==PIX_FMT_YUVJ422P \
|
||||
|| (x)==PIX_FMT_YUVJ440P \
|
||||
|| (x)==PIX_FMT_YUVJ444P \
|
||||
|| isAnyRGB(x) \
|
||||
|| isRGBinBytes(x) \
|
||||
|| isBGRinBytes(x) \
|
||||
|| (x)==PIX_FMT_RGB565 \
|
||||
|| (x)==PIX_FMT_RGB555 \
|
||||
|| (x)==PIX_FMT_RGB444 \
|
||||
|| (x)==PIX_FMT_BGR565 \
|
||||
|| (x)==PIX_FMT_BGR555 \
|
||||
|| (x)==PIX_FMT_BGR444 \
|
||||
|| (x)==PIX_FMT_RGB8 \
|
||||
|| (x)==PIX_FMT_BGR8 \
|
||||
|| (x)==PIX_FMT_RGB4_BYTE \
|
||||
|| (x)==PIX_FMT_BGR4_BYTE \
|
||||
|| (x)==PIX_FMT_RGB4 \
|
||||
|| (x)==PIX_FMT_BGR4 \
|
||||
|| (x)==PIX_FMT_MONOBLACK \
|
||||
|| (x)==PIX_FMT_MONOWHITE \
|
||||
|| (x)==PIX_FMT_NV12 \
|
||||
|| (x)==PIX_FMT_NV21 \
|
||||
|| (x)==PIX_FMT_GRAY16BE \
|
||||
|
@ -70,7 +70,7 @@
|
||||
: "%"REG_d, "%"REG_S\
|
||||
);
|
||||
|
||||
static inline void RENAME(yuv2yuvX)(SwsContext *c, const int16_t *lumFilter,
|
||||
static void RENAME(yuv2yuvX)(SwsContext *c, const int16_t *lumFilter,
|
||||
const int16_t **lumSrc, int lumFilterSize,
|
||||
const int16_t *chrFilter, const int16_t **chrUSrc,
|
||||
const int16_t **chrVSrc,
|
||||
@ -155,7 +155,7 @@ static inline void RENAME(yuv2yuvX)(SwsContext *c, const int16_t *lumFilter,
|
||||
: "%"REG_a, "%"REG_d, "%"REG_S\
|
||||
);
|
||||
|
||||
static inline void RENAME(yuv2yuvX_ar)(SwsContext *c, const int16_t *lumFilter,
|
||||
static void RENAME(yuv2yuvX_ar)(SwsContext *c, const int16_t *lumFilter,
|
||||
const int16_t **lumSrc, int lumFilterSize,
|
||||
const int16_t *chrFilter, const int16_t **chrUSrc,
|
||||
const int16_t **chrVSrc,
|
||||
@ -180,7 +180,7 @@ static inline void RENAME(yuv2yuvX_ar)(SwsContext *c, const int16_t *lumFilter,
|
||||
YSCALEYUV2YV12X_ACCURATE(LUM_MMX_FILTER_OFFSET, dest, dstW, 0)
|
||||
}
|
||||
|
||||
static inline void RENAME(yuv2yuv1)(SwsContext *c, const int16_t *lumSrc,
|
||||
static void RENAME(yuv2yuv1)(SwsContext *c, const int16_t *lumSrc,
|
||||
const int16_t *chrUSrc, const int16_t *chrVSrc,
|
||||
const int16_t *alpSrc,
|
||||
uint8_t *dest, uint8_t *uDest, uint8_t *vDest,
|
||||
@ -214,7 +214,7 @@ static inline void RENAME(yuv2yuv1)(SwsContext *c, const int16_t *lumSrc,
|
||||
}
|
||||
}
|
||||
|
||||
static inline void RENAME(yuv2yuv1_ar)(SwsContext *c, const int16_t *lumSrc,
|
||||
static void RENAME(yuv2yuv1_ar)(SwsContext *c, const int16_t *lumSrc,
|
||||
const int16_t *chrUSrc, const int16_t *chrVSrc,
|
||||
const int16_t *alpSrc,
|
||||
uint8_t *dest, uint8_t *uDest, uint8_t *vDest,
|
||||
@ -470,7 +470,7 @@ static inline void RENAME(yuv2yuv1_ar)(SwsContext *c, const int16_t *lumSrc,
|
||||
" jb 1b \n\t"
|
||||
#define WRITEBGR32(dst, dstw, index, b, g, r, a, q0, q2, q3, t) REAL_WRITEBGR32(dst, dstw, index, b, g, r, a, q0, q2, q3, t)
|
||||
|
||||
static inline void RENAME(yuv2rgb32_X_ar)(SwsContext *c, const int16_t *lumFilter,
|
||||
static void RENAME(yuv2rgb32_X_ar)(SwsContext *c, const int16_t *lumFilter,
|
||||
const int16_t **lumSrc, int lumFilterSize,
|
||||
const int16_t *chrFilter, const int16_t **chrUSrc,
|
||||
const int16_t **chrVSrc,
|
||||
@ -503,7 +503,7 @@ static inline void RENAME(yuv2rgb32_X_ar)(SwsContext *c, const int16_t *lumFilte
|
||||
}
|
||||
}
|
||||
|
||||
static inline void RENAME(yuv2rgb32_X)(SwsContext *c, const int16_t *lumFilter,
|
||||
static void RENAME(yuv2rgb32_X)(SwsContext *c, const int16_t *lumFilter,
|
||||
const int16_t **lumSrc, int lumFilterSize,
|
||||
const int16_t *chrFilter, const int16_t **chrUSrc,
|
||||
const int16_t **chrVSrc,
|
||||
@ -560,7 +560,7 @@ static inline void RENAME(yuv2rgb32_X)(SwsContext *c, const int16_t *lumFilter,
|
||||
" jb 1b \n\t"
|
||||
#define WRITERGB16(dst, dstw, index) REAL_WRITERGB16(dst, dstw, index)
|
||||
|
||||
static inline void RENAME(yuv2rgb565_X_ar)(SwsContext *c, const int16_t *lumFilter,
|
||||
static void RENAME(yuv2rgb565_X_ar)(SwsContext *c, const int16_t *lumFilter,
|
||||
const int16_t **lumSrc, int lumFilterSize,
|
||||
const int16_t *chrFilter, const int16_t **chrUSrc,
|
||||
const int16_t **chrVSrc,
|
||||
@ -584,7 +584,7 @@ static inline void RENAME(yuv2rgb565_X_ar)(SwsContext *c, const int16_t *lumFilt
|
||||
YSCALEYUV2PACKEDX_END
|
||||
}
|
||||
|
||||
static inline void RENAME(yuv2rgb565_X)(SwsContext *c, const int16_t *lumFilter,
|
||||
static void RENAME(yuv2rgb565_X)(SwsContext *c, const int16_t *lumFilter,
|
||||
const int16_t **lumSrc, int lumFilterSize,
|
||||
const int16_t *chrFilter, const int16_t **chrUSrc,
|
||||
const int16_t **chrVSrc,
|
||||
@ -637,7 +637,7 @@ static inline void RENAME(yuv2rgb565_X)(SwsContext *c, const int16_t *lumFilter,
|
||||
" jb 1b \n\t"
|
||||
#define WRITERGB15(dst, dstw, index) REAL_WRITERGB15(dst, dstw, index)
|
||||
|
||||
static inline void RENAME(yuv2rgb555_X_ar)(SwsContext *c, const int16_t *lumFilter,
|
||||
static void RENAME(yuv2rgb555_X_ar)(SwsContext *c, const int16_t *lumFilter,
|
||||
const int16_t **lumSrc, int lumFilterSize,
|
||||
const int16_t *chrFilter, const int16_t **chrUSrc,
|
||||
const int16_t **chrVSrc,
|
||||
@ -661,7 +661,7 @@ static inline void RENAME(yuv2rgb555_X_ar)(SwsContext *c, const int16_t *lumFilt
|
||||
YSCALEYUV2PACKEDX_END
|
||||
}
|
||||
|
||||
static inline void RENAME(yuv2rgb555_X)(SwsContext *c, const int16_t *lumFilter,
|
||||
static void RENAME(yuv2rgb555_X)(SwsContext *c, const int16_t *lumFilter,
|
||||
const int16_t **lumSrc, int lumFilterSize,
|
||||
const int16_t *chrFilter, const int16_t **chrUSrc,
|
||||
const int16_t **chrVSrc,
|
||||
@ -794,7 +794,7 @@ static inline void RENAME(yuv2rgb555_X)(SwsContext *c, const int16_t *lumFilter,
|
||||
#define WRITEBGR24(dst, dstw, index) WRITEBGR24MMX(dst, dstw, index)
|
||||
#endif
|
||||
|
||||
static inline void RENAME(yuv2bgr24_X_ar)(SwsContext *c, const int16_t *lumFilter,
|
||||
static void RENAME(yuv2bgr24_X_ar)(SwsContext *c, const int16_t *lumFilter,
|
||||
const int16_t **lumSrc, int lumFilterSize,
|
||||
const int16_t *chrFilter, const int16_t **chrUSrc,
|
||||
const int16_t **chrVSrc,
|
||||
@ -818,7 +818,7 @@ static inline void RENAME(yuv2bgr24_X_ar)(SwsContext *c, const int16_t *lumFilte
|
||||
);
|
||||
}
|
||||
|
||||
static inline void RENAME(yuv2bgr24_X)(SwsContext *c, const int16_t *lumFilter,
|
||||
static void RENAME(yuv2bgr24_X)(SwsContext *c, const int16_t *lumFilter,
|
||||
const int16_t **lumSrc, int lumFilterSize,
|
||||
const int16_t *chrFilter, const int16_t **chrUSrc,
|
||||
const int16_t **chrVSrc,
|
||||
@ -859,7 +859,7 @@ static inline void RENAME(yuv2bgr24_X)(SwsContext *c, const int16_t *lumFilter,
|
||||
" jb 1b \n\t"
|
||||
#define WRITEYUY2(dst, dstw, index) REAL_WRITEYUY2(dst, dstw, index)
|
||||
|
||||
static inline void RENAME(yuv2yuyv422_X_ar)(SwsContext *c, const int16_t *lumFilter,
|
||||
static void RENAME(yuv2yuyv422_X_ar)(SwsContext *c, const int16_t *lumFilter,
|
||||
const int16_t **lumSrc, int lumFilterSize,
|
||||
const int16_t *chrFilter, const int16_t **chrUSrc,
|
||||
const int16_t **chrVSrc,
|
||||
@ -880,7 +880,7 @@ static inline void RENAME(yuv2yuyv422_X_ar)(SwsContext *c, const int16_t *lumFil
|
||||
YSCALEYUV2PACKEDX_END
|
||||
}
|
||||
|
||||
static inline void RENAME(yuv2yuyv422_X)(SwsContext *c, const int16_t *lumFilter,
|
||||
static void RENAME(yuv2yuyv422_X)(SwsContext *c, const int16_t *lumFilter,
|
||||
const int16_t **lumSrc, int lumFilterSize,
|
||||
const int16_t *chrFilter, const int16_t **chrUSrc,
|
||||
const int16_t **chrVSrc,
|
||||
@ -981,7 +981,7 @@ static inline void RENAME(yuv2yuyv422_X)(SwsContext *c, const int16_t *lumFilter
|
||||
/**
|
||||
* vertical bilinear scale YV12 to RGB
|
||||
*/
|
||||
static inline void RENAME(yuv2rgb32_2)(SwsContext *c, const uint16_t *buf0,
|
||||
static void RENAME(yuv2rgb32_2)(SwsContext *c, const uint16_t *buf0,
|
||||
const uint16_t *buf1, const uint16_t *ubuf0,
|
||||
const uint16_t *ubuf1, const uint16_t *vbuf0,
|
||||
const uint16_t *vbuf1, const uint16_t *abuf0,
|
||||
@ -1043,7 +1043,7 @@ static inline void RENAME(yuv2rgb32_2)(SwsContext *c, const uint16_t *buf0,
|
||||
}
|
||||
}
|
||||
|
||||
static inline void RENAME(yuv2bgr24_2)(SwsContext *c, const uint16_t *buf0,
|
||||
static void RENAME(yuv2bgr24_2)(SwsContext *c, const uint16_t *buf0,
|
||||
const uint16_t *buf1, const uint16_t *ubuf0,
|
||||
const uint16_t *ubuf1, const uint16_t *vbuf0,
|
||||
const uint16_t *vbuf1, const uint16_t *abuf0,
|
||||
@ -1065,7 +1065,7 @@ static inline void RENAME(yuv2bgr24_2)(SwsContext *c, const uint16_t *buf0,
|
||||
);
|
||||
}
|
||||
|
||||
static inline void RENAME(yuv2rgb555_2)(SwsContext *c, const uint16_t *buf0,
|
||||
static void RENAME(yuv2rgb555_2)(SwsContext *c, const uint16_t *buf0,
|
||||
const uint16_t *buf1, const uint16_t *ubuf0,
|
||||
const uint16_t *ubuf1, const uint16_t *vbuf0,
|
||||
const uint16_t *vbuf1, const uint16_t *abuf0,
|
||||
@ -1093,7 +1093,7 @@ static inline void RENAME(yuv2rgb555_2)(SwsContext *c, const uint16_t *buf0,
|
||||
);
|
||||
}
|
||||
|
||||
static inline void RENAME(yuv2rgb565_2)(SwsContext *c, const uint16_t *buf0,
|
||||
static void RENAME(yuv2rgb565_2)(SwsContext *c, const uint16_t *buf0,
|
||||
const uint16_t *buf1, const uint16_t *ubuf0,
|
||||
const uint16_t *ubuf1, const uint16_t *vbuf0,
|
||||
const uint16_t *vbuf1, const uint16_t *abuf0,
|
||||
@ -1161,7 +1161,7 @@ static inline void RENAME(yuv2rgb565_2)(SwsContext *c, const uint16_t *buf0,
|
||||
|
||||
#define YSCALEYUV2PACKED(index, c) REAL_YSCALEYUV2PACKED(index, c)
|
||||
|
||||
static inline void RENAME(yuv2yuyv422_2)(SwsContext *c, const uint16_t *buf0,
|
||||
static void RENAME(yuv2yuyv422_2)(SwsContext *c, const uint16_t *buf0,
|
||||
const uint16_t *buf1, const uint16_t *ubuf0,
|
||||
const uint16_t *ubuf1, const uint16_t *vbuf0,
|
||||
const uint16_t *vbuf1, const uint16_t *abuf0,
|
||||
@ -1300,7 +1300,7 @@ static inline void RENAME(yuv2yuyv422_2)(SwsContext *c, const uint16_t *buf0,
|
||||
/**
|
||||
* YV12 to RGB without scaling or interpolating
|
||||
*/
|
||||
static inline void RENAME(yuv2rgb32_1)(SwsContext *c, const uint16_t *buf0,
|
||||
static void RENAME(yuv2rgb32_1)(SwsContext *c, const uint16_t *buf0,
|
||||
const uint16_t *ubuf0, const uint16_t *ubuf1,
|
||||
const uint16_t *vbuf0, const uint16_t *vbuf1,
|
||||
const uint16_t *abuf0, uint8_t *dest,
|
||||
@ -1368,7 +1368,7 @@ static inline void RENAME(yuv2rgb32_1)(SwsContext *c, const uint16_t *buf0,
|
||||
}
|
||||
}
|
||||
|
||||
static inline void RENAME(yuv2bgr24_1)(SwsContext *c, const uint16_t *buf0,
|
||||
static void RENAME(yuv2bgr24_1)(SwsContext *c, const uint16_t *buf0,
|
||||
const uint16_t *ubuf0, const uint16_t *ubuf1,
|
||||
const uint16_t *vbuf0, const uint16_t *vbuf1,
|
||||
const uint16_t *abuf0, uint8_t *dest,
|
||||
@ -1406,7 +1406,7 @@ static inline void RENAME(yuv2bgr24_1)(SwsContext *c, const uint16_t *buf0,
|
||||
}
|
||||
}
|
||||
|
||||
static inline void RENAME(yuv2rgb555_1)(SwsContext *c, const uint16_t *buf0,
|
||||
static void RENAME(yuv2rgb555_1)(SwsContext *c, const uint16_t *buf0,
|
||||
const uint16_t *ubuf0, const uint16_t *ubuf1,
|
||||
const uint16_t *vbuf0, const uint16_t *vbuf1,
|
||||
const uint16_t *abuf0, uint8_t *dest,
|
||||
@ -1456,7 +1456,7 @@ static inline void RENAME(yuv2rgb555_1)(SwsContext *c, const uint16_t *buf0,
|
||||
}
|
||||
}
|
||||
|
||||
static inline void RENAME(yuv2rgb565_1)(SwsContext *c, const uint16_t *buf0,
|
||||
static void RENAME(yuv2rgb565_1)(SwsContext *c, const uint16_t *buf0,
|
||||
const uint16_t *ubuf0, const uint16_t *ubuf1,
|
||||
const uint16_t *vbuf0, const uint16_t *vbuf1,
|
||||
const uint16_t *abuf0, uint8_t *dest,
|
||||
@ -1543,7 +1543,7 @@ static inline void RENAME(yuv2rgb565_1)(SwsContext *c, const uint16_t *buf0,
|
||||
"psraw $7, %%mm7 \n\t"
|
||||
#define YSCALEYUV2PACKED1b(index, c) REAL_YSCALEYUV2PACKED1b(index, c)
|
||||
|
||||
static inline void RENAME(yuv2yuyv422_1)(SwsContext *c, const uint16_t *buf0,
|
||||
static void RENAME(yuv2yuyv422_1)(SwsContext *c, const uint16_t *buf0,
|
||||
const uint16_t *ubuf0, const uint16_t *ubuf1,
|
||||
const uint16_t *vbuf0, const uint16_t *vbuf1,
|
||||
const uint16_t *abuf0, uint8_t *dest,
|
||||
@ -1582,7 +1582,8 @@ static inline void RENAME(yuv2yuyv422_1)(SwsContext *c, const uint16_t *buf0,
|
||||
#if !COMPILE_TEMPLATE_MMX2
|
||||
//FIXME yuy2* can read up to 7 samples too much
|
||||
|
||||
static inline void RENAME(yuy2ToY)(uint8_t *dst, const uint8_t *src, int width, uint32_t *unused)
|
||||
static void RENAME(yuy2ToY)(uint8_t *dst, const uint8_t *src,
|
||||
int width, uint32_t *unused)
|
||||
{
|
||||
__asm__ volatile(
|
||||
"movq "MANGLE(bm01010101)", %%mm2 \n\t"
|
||||
@ -1601,7 +1602,9 @@ static inline void RENAME(yuy2ToY)(uint8_t *dst, const uint8_t *src, int width,
|
||||
);
|
||||
}
|
||||
|
||||
static inline void RENAME(yuy2ToUV)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src1, const uint8_t *src2, int width, uint32_t *unused)
|
||||
static void RENAME(yuy2ToUV)(uint8_t *dstU, uint8_t *dstV,
|
||||
const uint8_t *src1, const uint8_t *src2,
|
||||
int width, uint32_t *unused)
|
||||
{
|
||||
__asm__ volatile(
|
||||
"movq "MANGLE(bm01010101)", %%mm4 \n\t"
|
||||
@ -1627,7 +1630,9 @@ static inline void RENAME(yuy2ToUV)(uint8_t *dstU, uint8_t *dstV, const uint8_t
|
||||
assert(src1 == src2);
|
||||
}
|
||||
|
||||
static inline void RENAME(LEToUV)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src1, const uint8_t *src2, int width, uint32_t *unused)
|
||||
static void RENAME(LEToUV)(uint8_t *dstU, uint8_t *dstV,
|
||||
const uint8_t *src1, const uint8_t *src2,
|
||||
int width, uint32_t *unused)
|
||||
{
|
||||
__asm__ volatile(
|
||||
"mov %0, %%"REG_a" \n\t"
|
||||
@ -1653,7 +1658,8 @@ static inline void RENAME(LEToUV)(uint8_t *dstU, uint8_t *dstV, const uint8_t *s
|
||||
|
||||
/* This is almost identical to the previous, end exists only because
|
||||
* yuy2ToY/UV)(dst, src+1, ...) would have 100% unaligned accesses. */
|
||||
static inline void RENAME(uyvyToY)(uint8_t *dst, const uint8_t *src, int width, uint32_t *unused)
|
||||
static void RENAME(uyvyToY)(uint8_t *dst, const uint8_t *src,
|
||||
int width, uint32_t *unused)
|
||||
{
|
||||
__asm__ volatile(
|
||||
"mov %0, %%"REG_a" \n\t"
|
||||
@ -1671,7 +1677,9 @@ static inline void RENAME(uyvyToY)(uint8_t *dst, const uint8_t *src, int width,
|
||||
);
|
||||
}
|
||||
|
||||
static inline void RENAME(uyvyToUV)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src1, const uint8_t *src2, int width, uint32_t *unused)
|
||||
static void RENAME(uyvyToUV)(uint8_t *dstU, uint8_t *dstV,
|
||||
const uint8_t *src1, const uint8_t *src2,
|
||||
int width, uint32_t *unused)
|
||||
{
|
||||
__asm__ volatile(
|
||||
"movq "MANGLE(bm01010101)", %%mm4 \n\t"
|
||||
@ -1697,7 +1705,9 @@ static inline void RENAME(uyvyToUV)(uint8_t *dstU, uint8_t *dstV, const uint8_t
|
||||
assert(src1 == src2);
|
||||
}
|
||||
|
||||
static inline void RENAME(BEToUV)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src1, const uint8_t *src2, int width, uint32_t *unused)
|
||||
static void RENAME(BEToUV)(uint8_t *dstU, uint8_t *dstV,
|
||||
const uint8_t *src1, const uint8_t *src2,
|
||||
int width, uint32_t *unused)
|
||||
{
|
||||
__asm__ volatile(
|
||||
"movq "MANGLE(bm01010101)", %%mm4 \n\t"
|
||||
@ -1722,7 +1732,7 @@ static inline void RENAME(BEToUV)(uint8_t *dstU, uint8_t *dstV, const uint8_t *s
|
||||
);
|
||||
}
|
||||
|
||||
static inline void RENAME(nvXXtoUV)(uint8_t *dst1, uint8_t *dst2,
|
||||
static av_always_inline void RENAME(nvXXtoUV)(uint8_t *dst1, uint8_t *dst2,
|
||||
const uint8_t *src, int width)
|
||||
{
|
||||
__asm__ volatile(
|
||||
@ -1748,14 +1758,14 @@ static inline void RENAME(nvXXtoUV)(uint8_t *dst1, uint8_t *dst2,
|
||||
);
|
||||
}
|
||||
|
||||
static inline void RENAME(nv12ToUV)(uint8_t *dstU, uint8_t *dstV,
|
||||
static void RENAME(nv12ToUV)(uint8_t *dstU, uint8_t *dstV,
|
||||
const uint8_t *src1, const uint8_t *src2,
|
||||
int width, uint32_t *unused)
|
||||
{
|
||||
RENAME(nvXXtoUV)(dstU, dstV, src1, width);
|
||||
}
|
||||
|
||||
static inline void RENAME(nv21ToUV)(uint8_t *dstU, uint8_t *dstV,
|
||||
static void RENAME(nv21ToUV)(uint8_t *dstU, uint8_t *dstV,
|
||||
const uint8_t *src1, const uint8_t *src2,
|
||||
int width, uint32_t *unused)
|
||||
{
|
||||
@ -1763,7 +1773,8 @@ static inline void RENAME(nv21ToUV)(uint8_t *dstU, uint8_t *dstV,
|
||||
}
|
||||
#endif /* !COMPILE_TEMPLATE_MMX2 */
|
||||
|
||||
static inline void RENAME(bgr24ToY_mmx)(int16_t *dst, const uint8_t *src, int width, enum PixelFormat srcFormat)
|
||||
static av_always_inline void RENAME(bgr24ToY_mmx)(int16_t *dst, const uint8_t *src,
|
||||
int width, enum PixelFormat srcFormat)
|
||||
{
|
||||
|
||||
if(srcFormat == PIX_FMT_BGR24) {
|
||||
@ -1815,7 +1826,21 @@ static inline void RENAME(bgr24ToY_mmx)(int16_t *dst, const uint8_t *src, int wi
|
||||
);
|
||||
}
|
||||
|
||||
static inline void RENAME(bgr24ToUV_mmx)(int16_t *dstU, int16_t *dstV, const uint8_t *src, int width, enum PixelFormat srcFormat)
|
||||
static void RENAME(bgr24ToY)(int16_t *dst, const uint8_t *src,
|
||||
int width, uint32_t *unused)
|
||||
{
|
||||
RENAME(bgr24ToY_mmx)(dst, src, width, PIX_FMT_BGR24);
|
||||
}
|
||||
|
||||
static void RENAME(rgb24ToY)(int16_t *dst, const uint8_t *src,
|
||||
int width, uint32_t *unused)
|
||||
{
|
||||
RENAME(bgr24ToY_mmx)(dst, src, width, PIX_FMT_RGB24);
|
||||
}
|
||||
|
||||
static av_always_inline void RENAME(bgr24ToUV_mmx)(int16_t *dstU, int16_t *dstV,
|
||||
const uint8_t *src, int width,
|
||||
enum PixelFormat srcFormat)
|
||||
{
|
||||
__asm__ volatile(
|
||||
"movq 24(%4), %%mm6 \n\t"
|
||||
@ -1871,23 +1896,17 @@ static inline void RENAME(bgr24ToUV_mmx)(int16_t *dstU, int16_t *dstV, const uin
|
||||
);
|
||||
}
|
||||
|
||||
static inline void RENAME(bgr24ToY)(int16_t *dst, const uint8_t *src, int width, uint32_t *unused)
|
||||
{
|
||||
RENAME(bgr24ToY_mmx)(dst, src, width, PIX_FMT_BGR24);
|
||||
}
|
||||
|
||||
static inline void RENAME(bgr24ToUV)(int16_t *dstU, int16_t *dstV, const uint8_t *src1, const uint8_t *src2, int width, uint32_t *unused)
|
||||
static void RENAME(bgr24ToUV)(int16_t *dstU, int16_t *dstV,
|
||||
const uint8_t *src1, const uint8_t *src2,
|
||||
int width, uint32_t *unused)
|
||||
{
|
||||
RENAME(bgr24ToUV_mmx)(dstU, dstV, src1, width, PIX_FMT_BGR24);
|
||||
assert(src1 == src2);
|
||||
}
|
||||
|
||||
static inline void RENAME(rgb24ToY)(int16_t *dst, const uint8_t *src, int width, uint32_t *unused)
|
||||
{
|
||||
RENAME(bgr24ToY_mmx)(dst, src, width, PIX_FMT_RGB24);
|
||||
}
|
||||
|
||||
static inline void RENAME(rgb24ToUV)(int16_t *dstU, int16_t *dstV, const uint8_t *src1, const uint8_t *src2, int width, uint32_t *unused)
|
||||
static void RENAME(rgb24ToUV)(int16_t *dstU, int16_t *dstV,
|
||||
const uint8_t *src1, const uint8_t *src2,
|
||||
int width, uint32_t *unused)
|
||||
{
|
||||
assert(src1==src2);
|
||||
RENAME(bgr24ToUV_mmx)(dstU, dstV, src1, width, PIX_FMT_RGB24);
|
||||
@ -1895,8 +1914,10 @@ static inline void RENAME(rgb24ToUV)(int16_t *dstU, int16_t *dstV, const uint8_t
|
||||
|
||||
#if !COMPILE_TEMPLATE_MMX2
|
||||
// bilinear / bicubic scaling
|
||||
static inline void RENAME(hScale)(int16_t *dst, int dstW, const uint8_t *src, int srcW, int xInc,
|
||||
const int16_t *filter, const int16_t *filterPos, int filterSize)
|
||||
static void RENAME(hScale)(int16_t *dst, int dstW,
|
||||
const uint8_t *src, int srcW,
|
||||
int xInc, const int16_t *filter,
|
||||
const int16_t *filterPos, int filterSize)
|
||||
{
|
||||
assert(filterSize % 4 == 0 && filterSize>0);
|
||||
if (filterSize==4) { // Always true for upscaling, sometimes for down, too.
|
||||
@ -2208,9 +2229,9 @@ static inline void RENAME(hScale16)(int16_t *dst, int dstW, const uint16_t *src,
|
||||
|
||||
|
||||
#if COMPILE_TEMPLATE_MMX2
|
||||
static inline void RENAME(hyscale_fast)(SwsContext *c, int16_t *dst,
|
||||
int dstWidth, const uint8_t *src, int srcW,
|
||||
int xInc)
|
||||
static void RENAME(hyscale_fast)(SwsContext *c, int16_t *dst,
|
||||
int dstWidth, const uint8_t *src,
|
||||
int srcW, int xInc)
|
||||
{
|
||||
int16_t *filterPos = c->hLumFilterPos;
|
||||
int16_t *filter = c->hLumFilter;
|
||||
@ -2280,7 +2301,7 @@ static inline void RENAME(hyscale_fast)(SwsContext *c, int16_t *dst,
|
||||
dst[i] = src[srcW-1]*128;
|
||||
}
|
||||
|
||||
static inline void RENAME(hcscale_fast)(SwsContext *c, int16_t *dst1, int16_t *dst2,
|
||||
static void RENAME(hcscale_fast)(SwsContext *c, int16_t *dst1, int16_t *dst2,
|
||||
int dstWidth, const uint8_t *src1,
|
||||
const uint8_t *src2, int srcW, int xInc)
|
||||
{
|
||||
@ -2343,7 +2364,7 @@ static inline void RENAME(hcscale_fast)(SwsContext *c, int16_t *dst1, int16_t *d
|
||||
}
|
||||
#endif /* COMPILE_TEMPLATE_MMX2 */
|
||||
|
||||
static void RENAME(sws_init_swScale)(SwsContext *c)
|
||||
static av_cold void RENAME(sws_init_swScale)(SwsContext *c)
|
||||
{
|
||||
enum PixelFormat srcFormat = c->srcFormat,
|
||||
dstFormat = c->dstFormat;
|
||||
|
Loading…
Reference in New Issue
Block a user