From 8fb566fdf839206584b1dec7da2eb9c9540108fa Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 12 May 2011 15:15:07 +0200 Subject: [PATCH 1/7] ffmpeg: get rid of the 'q' key schizofrenia SIGINT for quitting should be enough for everybody. --- Changelog | 1 + configure | 2 -- ffmpeg.c | 39 +++------------------------------------ 3 files changed, 4 insertions(+), 38 deletions(-) diff --git a/Changelog b/Changelog index 3d3fe6eb57..f78150e03e 100644 --- a/Changelog +++ b/Changelog @@ -8,6 +8,7 @@ version : - fft and imdct optimizations for AVX (Sandy Bridge) processors - DPX image encoder - SMPTE 302M AES3 audio decoder +- Remove support for quitting ffmpeg with 'q', ctrl+c should be used. version 0.7_beta1: diff --git a/configure b/configure index 126a6b551c..d527ed1974 100755 --- a/configure +++ b/configure @@ -1069,7 +1069,6 @@ HAVE_LIST=" inet_aton inline_asm isatty - kbhit ldbrx libdc1394_1 libdc1394_2 @@ -2792,7 +2791,6 @@ check_func ${malloc_prefix}posix_memalign && enable posix_memalign check_func setrlimit check_func strerror_r check_func strtok_r -check_func_headers conio.h kbhit check_func_headers io.h setmode check_func_headers lzo/lzo1x.h lzo1x_999_compress check_lib2 "windows.h psapi.h" GetProcessMemoryInfo -lpsapi diff --git a/ffmpeg.c b/ffmpeg.c index 1c1be7c193..1def5426af 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -66,9 +66,6 @@ #include #endif -#if HAVE_KBHIT -#include -#endif #include #include "cmdutils.h" @@ -229,7 +226,6 @@ static int exit_on_error = 0; static int using_stdin = 0; static int verbose = 1; static int thread_count= 1; -static int q_pressed = 0; static int64_t video_size = 0; static int64_t audio_size = 0; static int64_t extra_size = 0; @@ -440,19 +436,9 @@ static void term_init(void) #endif } -/* read a key without blocking */ -static int read_key(void) -{ -#if HAVE_KBHIT - if(kbhit()) - return(getch()); -#endif - return -1; -} - static int decode_interrupt_cb(void) { - return q_pressed || (q_pressed = read_key() == 'q'); + return received_sigterm; } static int ffmpeg_exit(int ret) @@ -1894,7 +1880,6 @@ static int transcode(AVFormatContext **output_files, AVInputStream *ist, **ist_table = NULL; AVInputFile *file_table; char error[1024]; - int key; int want_sdp = 1; uint8_t no_packet[MAX_FILES]={0}; int no_packet_count=0; @@ -2456,14 +2441,8 @@ static int transcode(AVFormatContext **output_files, print_sdp(output_files, nb_output_files); } - if (!using_stdin && verbose >= 0) { -#if HAVE_KBHIT - fprintf(stderr, "Press [q] to stop encoding\n"); -#else + if (verbose >= 0) fprintf(stderr, "Press ctrl-c to stop encoding\n"); -#endif - avio_set_interrupt_cb(decode_interrupt_cb); - } term_init(); timer_start = av_gettime(); @@ -2477,15 +2456,6 @@ static int transcode(AVFormatContext **output_files, redo: ipts_min= 1e100; opts_min= 1e100; - /* if 'q' pressed, exits */ - if (!using_stdin) { - if (q_pressed) - break; - /* read_key() returns 0 on EOF */ - key = read_key(); - if (key == 'q') - break; - } /* select the stream that we must read now by looking at the smallest output pts */ @@ -4372,10 +4342,7 @@ int main(int argc, char **argv) #endif av_register_all(); -#if HAVE_ISATTY - if(isatty(STDIN_FILENO)) - avio_set_interrupt_cb(decode_interrupt_cb); -#endif + avio_set_interrupt_cb(decode_interrupt_cb); init_opts(); From dbe94539469b6d5113b37ea45eaf69ddbe34154e Mon Sep 17 00:00:00 2001 From: Stefano Sabatini Date: Mon, 11 Apr 2011 13:16:07 +0200 Subject: [PATCH 2/7] ffmpeg: use parse_number_and_die() when it makes sense Prefer parse_number_or_die() over atoi()/atol() parsing for the options: -pass, -top, -vc, and -qscale. Improve input validation. Signed-off-by: Stefano Sabatini Signed-off-by: Anton Khirnov --- ffmpeg.c | 39 ++++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/ffmpeg.c b/ffmpeg.c index 1def5426af..2a8a7d0a68 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -2788,19 +2788,20 @@ static int opt_metadata(const char *opt, const char *arg) return 0; } -static void opt_qscale(const char *arg) +static int opt_qscale(const char *opt, const char *arg) { - video_qscale = atof(arg); - if (video_qscale <= 0 || - video_qscale > 255) { + video_qscale = parse_number_or_die(opt, arg, OPT_FLOAT, 0, 255); + if (video_qscale == 0) { fprintf(stderr, "qscale must be > 0.0 and <= 255\n"); - ffmpeg_exit(1); + return AVERROR(EINVAL); } + return 0; } -static void opt_top_field_first(const char *arg) +static int opt_top_field_first(const char *opt, const char *arg) { - top_field_first= atoi(arg); + top_field_first = parse_number_or_die(opt, arg, OPT_INT, 0, 1); + return 0; } static int opt_thread_count(const char *opt, const char *arg) @@ -2842,9 +2843,10 @@ static int opt_audio_channels(const char *opt, const char *arg) return 0; } -static void opt_video_channel(const char *arg) +static int opt_video_channel(const char *opt, const char *arg) { - video_channel = strtol(arg, NULL, 0); + video_channel = parse_number_or_die(opt, arg, OPT_INT64, 0, INT_MAX); + return 0; } static void opt_video_standard(const char *arg) @@ -3825,15 +3827,10 @@ static void opt_output_file(const char *filename) } /* same option as mencoder */ -static void opt_pass(const char *pass_str) +static int opt_pass(const char *opt, const char *arg) { - int pass; - pass = atoi(pass_str); - if (pass != 1 && pass != 2) { - fprintf(stderr, "pass number can be only 1 or 2\n"); - ffmpeg_exit(1); - } - do_pass = pass; + do_pass = parse_number_or_die(opt, arg, OPT_INT, 1, 2); + return 0; } static int64_t getutime(void) @@ -4254,13 +4251,13 @@ static const OptionDef options[] = { { "intra", OPT_BOOL | OPT_EXPERT | OPT_VIDEO, {(void*)&intra_only}, "use only intra frames"}, { "vn", OPT_BOOL | OPT_VIDEO, {(void*)&video_disable}, "disable video" }, { "vdt", OPT_INT | HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)&video_discard}, "discard threshold", "n" }, - { "qscale", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_qscale}, "use fixed video quantizer scale (VBR)", "q" }, + { "qscale", HAS_ARG | OPT_FUNC2 | OPT_EXPERT | OPT_VIDEO, {(void*)opt_qscale}, "use fixed video quantizer scale (VBR)", "q" }, { "rc_override", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_video_rc_override_string}, "rate control override for specific intervals", "override" }, { "vcodec", HAS_ARG | OPT_VIDEO, {(void*)opt_video_codec}, "force video codec ('copy' to copy stream)", "codec" }, { "me_threshold", HAS_ARG | OPT_FUNC2 | OPT_EXPERT | OPT_VIDEO, {(void*)opt_me_threshold}, "motion estimaton threshold", "threshold" }, { "sameq", OPT_BOOL | OPT_VIDEO, {(void*)&same_quality}, "use same quantizer as source (implies VBR)" }, - { "pass", HAS_ARG | OPT_VIDEO, {(void*)&opt_pass}, "select the pass number (1 or 2)", "n" }, + { "pass", HAS_ARG | OPT_FUNC2 | OPT_VIDEO, {(void*)opt_pass}, "select the pass number (1 or 2)", "n" }, { "passlogfile", HAS_ARG | OPT_STRING | OPT_VIDEO, {(void*)&pass_logfilename_prefix}, "select two pass log file name prefix", "prefix" }, { "deinterlace", OPT_BOOL | OPT_EXPERT | OPT_VIDEO, {(void*)&do_deinterlace}, "deinterlace pictures" }, @@ -4272,7 +4269,7 @@ static const OptionDef options[] = { #endif { "intra_matrix", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_intra_matrix}, "specify intra matrix coeffs", "matrix" }, { "inter_matrix", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_inter_matrix}, "specify inter matrix coeffs", "matrix" }, - { "top", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_top_field_first}, "top=1/bottom=0/auto=-1 field first", "" }, + { "top", HAS_ARG | OPT_FUNC2 | OPT_EXPERT | OPT_VIDEO, {(void*)opt_top_field_first}, "top=1/bottom=0/auto=-1 field first", "" }, { "dc", OPT_INT | HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)&intra_dc_precision}, "intra_dc_precision", "precision" }, { "vtag", OPT_FUNC2 | HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_codec_tag}, "force video tag/fourcc", "fourcc/tag" }, { "newvideo", OPT_VIDEO | OPT_FUNC2, {(void*)opt_new_stream}, "add a new video stream to the current output stream" }, @@ -4304,7 +4301,7 @@ static const OptionDef options[] = { { "stag", OPT_FUNC2 | HAS_ARG | OPT_EXPERT | OPT_SUBTITLE, {(void*)opt_codec_tag}, "force subtitle tag/fourcc", "fourcc/tag" }, /* grab options */ - { "vc", HAS_ARG | OPT_EXPERT | OPT_VIDEO | OPT_GRAB, {(void*)opt_video_channel}, "set video grab channel (DV1394 only)", "channel" }, + { "vc", HAS_ARG | OPT_FUNC2 | OPT_EXPERT | OPT_VIDEO | OPT_GRAB, {(void*)opt_video_channel}, "set video grab channel (DV1394 only)", "channel" }, { "tvstd", HAS_ARG | OPT_EXPERT | OPT_VIDEO | OPT_GRAB, {(void*)opt_video_standard}, "set television standard (NTSC, PAL (SECAM))", "standard" }, { "isync", OPT_BOOL | OPT_EXPERT | OPT_GRAB, {(void*)&input_sync}, "sync read on input", "" }, From 7e19a6e86814b08073b4b8873598ef5d94e6345d Mon Sep 17 00:00:00 2001 From: Baptiste Coudurier Date: Wed, 30 Mar 2011 14:08:16 -0700 Subject: [PATCH 3/7] movenc: always write esds descriptor length using 4 bytes. ipod shuffle doesn't support anything else. Signed-off-by: Anton Khirnov --- libavformat/movenc.c | 14 +++----------- tests/ref/lavf/mov | 4 ++-- tests/ref/vsynth1/mpeg4 | 4 ++-- tests/ref/vsynth2/mpeg4 | 4 ++-- 4 files changed, 9 insertions(+), 17 deletions(-) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index bdd92f23b8..52c775a565 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -238,16 +238,9 @@ static int mov_write_enda_tag(AVIOContext *pb) return 10; } -static unsigned int descrLength(unsigned int len) -{ - int i; - for(i=1; len>>(7*i); i++); - return len + 1 + i; -} - static void putDescr(AVIOContext *pb, int tag, unsigned int size) { - int i= descrLength(size) - size - 2; + int i = 3; avio_w8(pb, tag); for(; i>0; i--) avio_w8(pb, (size>>(7*i)) | 0x80); @@ -257,15 +250,14 @@ static void putDescr(AVIOContext *pb, int tag, unsigned int size) static int mov_write_esds_tag(AVIOContext *pb, MOVTrack *track) // Basic { int64_t pos = avio_tell(pb); - int decoderSpecificInfoLen = track->vosLen ? descrLength(track->vosLen):0; + int decoderSpecificInfoLen = track->vosLen ? 5+track->vosLen : 0; avio_wb32(pb, 0); // size ffio_wfourcc(pb, "esds"); avio_wb32(pb, 0); // Version // ES descriptor - putDescr(pb, 0x03, 3 + descrLength(13 + decoderSpecificInfoLen) + - descrLength(1)); + putDescr(pb, 0x03, 3 + 5+13 + decoderSpecificInfoLen + 5+1); avio_wb16(pb, track->trackID); avio_w8(pb, 0x00); // flags (= no flags) diff --git a/tests/ref/lavf/mov b/tests/ref/lavf/mov index 943c605d93..22aac3600e 100644 --- a/tests/ref/lavf/mov +++ b/tests/ref/lavf/mov @@ -1,3 +1,3 @@ -c145305a775eb2de43cdf94eb1ab5240 *./tests/data/lavf/lavf.mov -357669 ./tests/data/lavf/lavf.mov +439684b82ccc1fdd24a23392c238ae53 *./tests/data/lavf/lavf.mov +357681 ./tests/data/lavf/lavf.mov ./tests/data/lavf/lavf.mov CRC=0x2f6a9b26 diff --git a/tests/ref/vsynth1/mpeg4 b/tests/ref/vsynth1/mpeg4 index 76b3904886..ebe2f5a613 100644 --- a/tests/ref/vsynth1/mpeg4 +++ b/tests/ref/vsynth1/mpeg4 @@ -1,4 +1,4 @@ -fd83f2ef5887a62b4d755d7cb5f0ac59 *./tests/data/vsynth1/odivx.mp4 -540144 ./tests/data/vsynth1/odivx.mp4 +080e75117f8142001b096cd977ba287e *./tests/data/vsynth1/odivx.mp4 +540156 ./tests/data/vsynth1/odivx.mp4 8828a375448dc5c2215163ba70656f89 *./tests/data/mpeg4.vsynth1.out.yuv stddev: 7.97 PSNR: 30.10 MAXDIFF: 105 bytes: 7603200/ 7603200 diff --git a/tests/ref/vsynth2/mpeg4 b/tests/ref/vsynth2/mpeg4 index 9a6158c67e..fe436e88f3 100644 --- a/tests/ref/vsynth2/mpeg4 +++ b/tests/ref/vsynth2/mpeg4 @@ -1,4 +1,4 @@ -47de227982e77830a2db278214a08773 *./tests/data/vsynth2/odivx.mp4 -119797 ./tests/data/vsynth2/odivx.mp4 +8ffbe8ce43fe126b12cf9621717d641b *./tests/data/vsynth2/odivx.mp4 +119809 ./tests/data/vsynth2/odivx.mp4 90a3577850239083a9042bef33c50e85 *./tests/data/mpeg4.vsynth2.out.yuv stddev: 5.34 PSNR: 33.57 MAXDIFF: 83 bytes: 7603200/ 7603200 From 2c9a5172d328259c5d76e588f2ddc12f439ffcd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reimar=20D=C3=B6ffinger?= Date: Tue, 29 Mar 2011 21:14:55 +0200 Subject: [PATCH 4/7] dfa: fix buffer overflow checks to avoid integer overflows. Signed-off-by: Anton Khirnov --- libavcodec/dfa.c | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/libavcodec/dfa.c b/libavcodec/dfa.c index b149791136..1556bc7acb 100644 --- a/libavcodec/dfa.c +++ b/libavcodec/dfa.c @@ -62,12 +62,14 @@ static int decode_tsw1(uint8_t *frame, int width, int height, const uint8_t *frame_start = frame; const uint8_t *frame_end = frame + width * height; int mask = 0x10000, bitbuf = 0; - int v, offset, count, segments; + int v, count, segments; + unsigned offset; segments = bytestream_get_le32(&src); - frame += bytestream_get_le32(&src); - if (frame < frame_start || frame > frame_end) + offset = bytestream_get_le32(&src); + if (frame_end - frame <= offset) return -1; + frame += offset; while (segments--) { if (mask == 0x10000) { if (src >= src_end) @@ -189,11 +191,11 @@ static int decode_bdlt(uint8_t *frame, int width, int height, int count, lines, segments; count = bytestream_get_le16(&src); - if (count >= height || width * count < 0) + if (count >= height) return -1; frame += width * count; lines = bytestream_get_le16(&src); - if (frame + lines * width > frame_end || src >= src_end) + if (count + lines > height || src >= src_end) return -1; while (lines--) { @@ -203,17 +205,17 @@ static int decode_bdlt(uint8_t *frame, int width, int height, while (segments--) { if (src_end - src < 3) return -1; - line_ptr += *src++; - if (line_ptr >= frame) + if (frame - line_ptr <= *src) return -1; + line_ptr += *src++; count = (int8_t)*src++; if (count >= 0) { - if (line_ptr + count > frame || src_end - src < count) + if (frame - line_ptr < count || src_end - src < count) return -1; bytestream_get_buffer(&src, line_ptr, count); } else { count = -count; - if (line_ptr + count > frame || src >= src_end) + if (frame - line_ptr < count || src >= src_end) return -1; memset(line_ptr, *src++, count); } @@ -232,15 +234,16 @@ static int decode_wdlt(uint8_t *frame, int width, int height, int count, i, v, lines, segments; lines = bytestream_get_le16(&src); - if (frame + lines * width > frame_end || src >= src_end) + if (lines > height || src >= src_end) return -1; while (lines--) { segments = bytestream_get_le16(&src); while ((segments & 0xC000) == 0xC000) { - frame -= (int16_t)segments * width; - if (frame >= frame_end) + unsigned delta = -((int16_t)segments * width); + if (frame_end - frame <= delta) return -1; + frame += delta; segments = bytestream_get_le16(&src); } if (segments & 0x8000) { @@ -252,18 +255,18 @@ static int decode_wdlt(uint8_t *frame, int width, int height, while (segments--) { if (src_end - src < 2) return -1; - line_ptr += *src++; - if (line_ptr >= frame) + if (frame - line_ptr <= *src) return -1; + line_ptr += *src++; count = (int8_t)*src++; if (count >= 0) { - if (line_ptr + count*2 > frame || src_end - src < count*2) + if (frame - line_ptr < count*2 || src_end - src < count*2) return -1; bytestream_get_buffer(&src, line_ptr, count*2); line_ptr += count * 2; } else { count = -count; - if (line_ptr + count*2 > frame || src_end - src < 2) + if (frame - line_ptr < count*2 || src_end - src < 2) return -1; v = bytestream_get_le16(&src); for (i = 0; i < count; i++) From 1550f45a8928f31c48f770b5ddf860c99a57687e Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Fri, 13 May 2011 16:39:17 +0100 Subject: [PATCH 5/7] Add av_clip_uintp2() function Signed-off-by: Mans Rullgard --- libavcodec/vp8.c | 4 +--- libavutil/common.h | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c index dc7eb2121a..38f38b7cb3 100644 --- a/libavcodec/vp8.c +++ b/libavcodec/vp8.c @@ -1329,9 +1329,7 @@ static av_always_inline void filter_level_for_mb(VP8Context *s, VP8Macroblock *m filter_level += s->lf_delta.mode[mb->mode]; } -/* Like av_clip for inputs 0 and max, where max is equal to (2^n-1) */ -#define POW2CLIP(x,max) (((x) & ~max) ? (-(x))>>31 & max : (x)); - filter_level = POW2CLIP(filter_level, 63); + filter_level = av_clip_uintp2(filter_level, 6); interior_limit = filter_level; if (s->filter.sharpness) { diff --git a/libavutil/common.h b/libavutil/common.h index e5c1dfdff5..a985fa4804 100644 --- a/libavutil/common.h +++ b/libavutil/common.h @@ -169,6 +169,18 @@ static av_always_inline av_const int32_t av_clipl_int32_c(int64_t a) else return a; } +/** + * Clip a signed integer to an unsigned power of two range. + * @param a value to clip + * @param p bit position to clip at + * @return clipped value + */ +static av_always_inline av_const unsigned av_clip_uintp2_c(int a, int p) +{ + if (a & ~((1<> 31 & ((1< Date: Fri, 13 May 2011 16:45:04 -0400 Subject: [PATCH 6/7] swscale: fix clipping of 9/10bit YUV420P. --- libswscale/swscale.c | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/libswscale/swscale.c b/libswscale/swscale.c index b63a3868c5..4394a7d9ea 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -218,6 +218,20 @@ static av_always_inline void yuv2yuvX16inC_template(const int16_t *lumFilter, co int i; int shift = 11 + 16 - output_bits; +#define output_pixel(pos, val) \ + if (big_endian) { \ + if (output_bits == 16) { \ + AV_WB16(pos, av_clip_uint16(val >> shift)); \ + } else { \ + AV_WB16(pos, av_clip_uintp2(val >> shift, output_bits)); \ + } \ + } else { \ + if (output_bits == 16) { \ + AV_WL16(pos, av_clip_uint16(val >> shift)); \ + } else { \ + AV_WL16(pos, av_clip_uintp2(val >> shift, output_bits)); \ + } \ + } for (i = 0; i < dstW; i++) { int val = 1 << 10; int j; @@ -225,11 +239,7 @@ static av_always_inline void yuv2yuvX16inC_template(const int16_t *lumFilter, co for (j = 0; j < lumFilterSize; j++) val += lumSrc[j][i] * lumFilter[j]; - if (big_endian) { - AV_WB16(&dest[i], av_clip_uint16(val >> shift)); - } else { - AV_WL16(&dest[i], av_clip_uint16(val >> shift)); - } + output_pixel(&dest[i], val); } if (uDest) { @@ -243,13 +253,8 @@ static av_always_inline void yuv2yuvX16inC_template(const int16_t *lumFilter, co v += chrSrc[j][i + VOFW] * chrFilter[j]; } - if (big_endian) { - AV_WB16(&uDest[i], av_clip_uint16(u >> shift)); - AV_WB16(&vDest[i], av_clip_uint16(v >> shift)); - } else { - AV_WL16(&uDest[i], av_clip_uint16(u >> shift)); - AV_WL16(&vDest[i], av_clip_uint16(v >> shift)); - } + output_pixel(&uDest[i], u); + output_pixel(&vDest[i], v); } } @@ -261,11 +266,7 @@ static av_always_inline void yuv2yuvX16inC_template(const int16_t *lumFilter, co for (j = 0; j < lumFilterSize; j++) val += alpSrc[j][i] * lumFilter[j]; - if (big_endian) { - AV_WB16(&aDest[i], av_clip_uint16(val >> shift)); - } else { - AV_WL16(&aDest[i], av_clip_uint16(val >> shift)); - } + output_pixel(&aDest[i], val); } } } From 9f54e461fecec7a97ec1b97ae4468135ea770609 Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Fri, 13 May 2011 10:28:49 -0400 Subject: [PATCH 7/7] swscale: properly inline bits/endianness in yuv2yuvX16inC(). --- libswscale/swscale.c | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 4394a7d9ea..f5c4e88688 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -271,6 +271,27 @@ static av_always_inline void yuv2yuvX16inC_template(const int16_t *lumFilter, co } } +#define yuv2NBPS(bits, BE_LE, is_be) \ +static void yuv2yuvX ## bits ## BE_LE ## _c(const int16_t *lumFilter, \ + const int16_t **lumSrc, int lumFilterSize, \ + const int16_t *chrFilter, const int16_t **chrSrc, \ + int chrFilterSize, const int16_t **alpSrc, \ + uint16_t *dest, uint16_t *uDest, uint16_t *vDest, \ + uint16_t *aDest, int dstW, int chrDstW) \ +{ \ + yuv2yuvX16inC_template(lumFilter, lumSrc, lumFilterSize, \ + chrFilter, chrSrc, chrFilterSize, \ + alpSrc, \ + dest, uDest, vDest, aDest, \ + dstW, chrDstW, is_be, bits); \ +} +yuv2NBPS( 9, BE, 1); +yuv2NBPS( 9, LE, 0); +yuv2NBPS(10, BE, 1); +yuv2NBPS(10, LE, 0); +yuv2NBPS(16, BE, 1); +yuv2NBPS(16, LE, 0); + static inline void yuv2yuvX16inC(const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize, const int16_t *chrFilter, const int16_t **chrSrc, int chrFilterSize, const int16_t **alpSrc, uint16_t *dest, uint16_t *uDest, uint16_t *vDest, uint16_t *aDest, int dstW, int chrDstW, @@ -278,17 +299,17 @@ static inline void yuv2yuvX16inC(const int16_t *lumFilter, const int16_t **lumSr { #define conv16(bits) \ if (isBE(dstFormat)) { \ - yuv2yuvX16inC_template(lumFilter, lumSrc, lumFilterSize, \ + yuv2yuvX ## bits ## BE_c(lumFilter, lumSrc, lumFilterSize, \ chrFilter, chrSrc, chrFilterSize, \ alpSrc, \ dest, uDest, vDest, aDest, \ - dstW, chrDstW, 1, bits); \ + dstW, chrDstW); \ } else { \ - yuv2yuvX16inC_template(lumFilter, lumSrc, lumFilterSize, \ + yuv2yuvX ## bits ## LE_c(lumFilter, lumSrc, lumFilterSize, \ chrFilter, chrSrc, chrFilterSize, \ alpSrc, \ dest, uDest, vDest, aDest, \ - dstW, chrDstW, 0, bits); \ + dstW, chrDstW); \ } if (is16BPS(dstFormat)) { conv16(16);