From 14af74e9a001f0544ee2362b624344154c4e8a0c Mon Sep 17 00:00:00 2001 From: Anton Mitrofanov Date: Mon, 2 Apr 2012 09:25:19 -0700 Subject: [PATCH 01/11] h264: fix 4:2:2 PCM-macroblocks decoding Fixes bug 239. Signed-off-by: Ronald S. Bultje --- libavcodec/h264.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/libavcodec/h264.c b/libavcodec/h264.c index fe11686941..6a1a8b696d 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -2138,10 +2138,12 @@ static av_always_inline void hl_decode_mb_internal(H264Context *h, int simple, if (!simple && IS_INTRA_PCM(mb_type)) { if (pixel_shift) { + static const uint16_t mb_sizes[4] = { 256, 384, 512, 768 }; const int bit_depth = h->sps.bit_depth_luma; int j; GetBitContext gb; - init_get_bits(&gb, (uint8_t *)h->mb, 384 * bit_depth); + init_get_bits(&gb, (uint8_t *)h->mb, + mb_sizes[h->sps.chroma_format_idc] * bit_depth); for (i = 0; i < 16; i++) { uint16_t *tmp_y = (uint16_t *)(dest_y + i * linesize); @@ -2175,7 +2177,7 @@ static av_always_inline void hl_decode_mb_internal(H264Context *h, int simple, } } else { for (i = 0; i < 16; i++) - memcpy(dest_y + i * linesize, h->mb + i * 8, 16); + memcpy(dest_y + i * linesize, (uint8_t *)h->mb + i * 16, 16); if (simple || !CONFIG_GRAY || !(s->flags & CODEC_FLAG_GRAY)) { if (!h->sps.chroma_format_idc) { for (i = 0; i < block_h; i++) { @@ -2183,9 +2185,11 @@ static av_always_inline void hl_decode_mb_internal(H264Context *h, int simple, memset(dest_cr + i * uvlinesize, 128, 8); } } else { + uint8_t *src_cb = (uint8_t *)h->mb + 256; + uint8_t *src_cr = (uint8_t *)h->mb + 256 + block_h * 8; for (i = 0; i < block_h; i++) { - memcpy(dest_cb + i * uvlinesize, h->mb + 128 + i * 4, 8); - memcpy(dest_cr + i * uvlinesize, h->mb + 160 + i * 4, 8); + memcpy(dest_cb + i * uvlinesize, src_cb + i * 8, 8); + memcpy(dest_cr + i * uvlinesize, src_cr + i * 8, 8); } } } @@ -2374,7 +2378,8 @@ static av_always_inline void hl_decode_mb_444_internal(H264Context *h, } else { for (p = 0; p < plane_count; p++) for (i = 0; i < 16; i++) - memcpy(dest[p] + i * linesize, h->mb + p * 128 + i * 8, 16); + memcpy(dest[p] + i * linesize, + (uint8_t *)h->mb + p * 256 + i * 16, 16); } } else { if (IS_INTRA(mb_type)) { From 1f068e4450620f4f6e20f024e442e3fd47876e37 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Wed, 4 Apr 2012 10:08:37 +0200 Subject: [PATCH 02/11] vf_unsharp: Mark readonly variable as const. This fixes the following warning: libavfilter/vf_unsharp.c:106: warning: initialization discards qualifiers from pointer target type --- libavfilter/vf_unsharp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavfilter/vf_unsharp.c b/libavfilter/vf_unsharp.c index a40df137b6..7aca2cf32f 100644 --- a/libavfilter/vf_unsharp.c +++ b/libavfilter/vf_unsharp.c @@ -103,8 +103,8 @@ static void apply_unsharp( uint8_t *dst, int dst_stride, tmp1 = sc[z + 1][x + fp->steps_x] + tmp2; sc[z + 1][x + fp->steps_x] = tmp2; } if (x >= fp->steps_x && y >= fp->steps_y) { - uint8_t* srx = src - fp->steps_y * src_stride + x - fp->steps_x; - uint8_t* dsx = dst - fp->steps_y * dst_stride + x - fp->steps_x; + const uint8_t *srx = src - fp->steps_y * src_stride + x - fp->steps_x; + uint8_t *dsx = dst - fp->steps_y * dst_stride + x - fp->steps_x; res = (int32_t)*srx + ((((int32_t) * srx - (int32_t)((tmp1 + fp->halfscale) >> fp->scalebits)) * fp->amount) >> 16); *dsx = av_clip_uint8(res); From e484265c9712dd108c61f21bbc7644a2b791f36f Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Wed, 4 Apr 2012 10:06:58 +0200 Subject: [PATCH 03/11] aacenc: Mark deinterleave_input_samples argument as const. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes the warning: libavcodec/aacenc.c:524: warning: passing argument 2 of ‘deinterleave_input_samples’ discards qualifiers from pointer target type --- libavcodec/aacenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c index 952b6149f1..bc99a443b3 100644 --- a/libavcodec/aacenc.c +++ b/libavcodec/aacenc.c @@ -477,7 +477,7 @@ static void put_bitstream_info(AVCodecContext *avctx, AACEncContext *s, * Deinterleave input samples. * Channels are reordered from Libav's default order to AAC order. */ -static void deinterleave_input_samples(AACEncContext *s, AVFrame *frame) +static void deinterleave_input_samples(AACEncContext *s, const AVFrame *frame) { int ch, i; const int sinc = s->channels; From bc0bdda77b8df4c963dde55793dcecb65232c21a Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Wed, 4 Apr 2012 10:50:29 -0700 Subject: [PATCH 04/11] swscale: handle complete dimensions for monoblack/white. Fixes bug 269. --- libswscale/input.c | 6 ++++-- libswscale/output.c | 10 +++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/libswscale/input.c b/libswscale/input.c index e636eac1f6..b4855093a0 100644 --- a/libswscale/input.c +++ b/libswscale/input.c @@ -309,7 +309,8 @@ static void monowhite2Y_c(uint8_t *dst, const uint8_t *src, int width, uint32_t *unused) { int i, j; - for (i=0; i> 3; + for (i = 0; i < width; i++) { int d= ~src[i]; for(j=0; j<8; j++) dst[8*i+j]= ((d>>(7-j))&1)*255; @@ -320,7 +321,8 @@ static void monoblack2Y_c(uint8_t *dst, const uint8_t *src, int width, uint32_t *unused) { int i, j; - for (i=0; i> 3; + for (i = 0; i < width; i++) { int d= src[i]; for(j=0; j<8; j++) dst[8*i+j]= ((d>>(7-j))&1)*255; diff --git a/libswscale/output.c b/libswscale/output.c index 533fcd945d..f1acf9ec92 100644 --- a/libswscale/output.c +++ b/libswscale/output.c @@ -317,7 +317,7 @@ yuv2mono_X_c_template(SwsContext *c, const int16_t *lumFilter, int i; unsigned acc = 0; - for (i = 0; i < dstW - 1; i += 2) { + for (i = 0; i < dstW; i += 2) { int j; int Y1 = 1 << 18; int Y2 = 1 << 18; @@ -338,6 +338,10 @@ yuv2mono_X_c_template(SwsContext *c, const int16_t *lumFilter, output_pixel(*dest++, acc); } } + + if (i & 6) { + output_pixel(*dest, acc); + } } static av_always_inline void @@ -352,7 +356,7 @@ yuv2mono_2_c_template(SwsContext *c, const int16_t *buf[2], int yalpha1 = 4095 - yalpha; int i; - for (i = 0; i < dstW - 7; i += 8) { + for (i = 0; i < dstW; i += 8) { int Y, acc = 0; Y = (buf0[i + 0] * yalpha1 + buf1[i + 0] * yalpha) >> 19; @@ -385,7 +389,7 @@ yuv2mono_1_c_template(SwsContext *c, const int16_t *buf0, const uint8_t * const d128 = dither_8x8_220[y & 7]; int i; - for (i = 0; i < dstW - 7; i += 8) { + for (i = 0; i < dstW; i += 8) { int acc = 0; accumulate_bit(acc, (buf0[i + 0] >> 7) + d128[0]); From 7756859a313497c3cfb33ab2bd3feb168c55d917 Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Wed, 4 Apr 2012 11:16:23 -0700 Subject: [PATCH 05/11] fate: add BMP tests. --- tests/Makefile | 1 + tests/fate/bmp.mak | 41 +++++++++++++++++++++++++++++++++++ tests/ref/fate/bmp-15bit | 2 ++ tests/ref/fate/bmp-15bit-mask | 2 ++ tests/ref/fate/bmp-16bit-mask | 2 ++ tests/ref/fate/bmp-1bit | 2 ++ tests/ref/fate/bmp-24bit | 2 ++ tests/ref/fate/bmp-32bit | 2 ++ tests/ref/fate/bmp-32bit-mask | 2 ++ tests/ref/fate/bmp-4bit | 2 ++ tests/ref/fate/bmp-4bit-os2 | 2 ++ tests/ref/fate/bmp-8bit | 2 ++ tests/ref/fate/bmp-8bit-os2 | 2 ++ tests/ref/fate/bmp-rle4 | 2 ++ tests/ref/fate/bmp-rle8 | 2 ++ 15 files changed, 68 insertions(+) create mode 100644 tests/fate/bmp.mak create mode 100644 tests/ref/fate/bmp-15bit create mode 100644 tests/ref/fate/bmp-15bit-mask create mode 100644 tests/ref/fate/bmp-16bit-mask create mode 100644 tests/ref/fate/bmp-1bit create mode 100644 tests/ref/fate/bmp-24bit create mode 100644 tests/ref/fate/bmp-32bit create mode 100644 tests/ref/fate/bmp-32bit-mask create mode 100644 tests/ref/fate/bmp-4bit create mode 100644 tests/ref/fate/bmp-4bit-os2 create mode 100644 tests/ref/fate/bmp-8bit create mode 100644 tests/ref/fate/bmp-8bit-os2 create mode 100644 tests/ref/fate/bmp-rle4 create mode 100644 tests/ref/fate/bmp-rle8 diff --git a/tests/Makefile b/tests/Makefile index 4c21a6a5a4..52a9fa34aa 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -29,6 +29,7 @@ include $(SRC_PATH)/tests/fate/amrnb.mak include $(SRC_PATH)/tests/fate/amrwb.mak include $(SRC_PATH)/tests/fate/atrac.mak include $(SRC_PATH)/tests/fate/audio.mak +include $(SRC_PATH)/tests/fate/bmp.mak include $(SRC_PATH)/tests/fate/cdxl.mak include $(SRC_PATH)/tests/fate/dct.mak include $(SRC_PATH)/tests/fate/demux.mak diff --git a/tests/fate/bmp.mak b/tests/fate/bmp.mak new file mode 100644 index 0000000000..56b5059a33 --- /dev/null +++ b/tests/fate/bmp.mak @@ -0,0 +1,41 @@ +FATE_BMP += fate-bmp-1bit +fate-bmp-1bit: CMD = framecrc -i $(SAMPLES)/bmp/test1.bmp -pix_fmt rgb24 + +FATE_BMP += fate-bmp-4bit +fate-bmp-4bit: CMD = framecrc -i $(SAMPLES)/bmp/test4.bmp -pix_fmt rgb24 + +FATE_BMP += fate-bmp-4bit-os2 +fate-bmp-4bit-os2: CMD = framecrc -i $(SAMPLES)/bmp/test4os2v2.bmp -pix_fmt rgb24 + +FATE_BMP += fate-bmp-8bit +fate-bmp-8bit: CMD = framecrc -i $(SAMPLES)/bmp/test8.bmp -pix_fmt rgb24 + +FATE_BMP += fate-bmp-8bit-os2 +fate-bmp-8bit-os2: CMD = framecrc -i $(SAMPLES)/bmp/test8os2.bmp -pix_fmt rgb24 + +FATE_BMP += fate-bmp-15bit +fate-bmp-15bit: CMD = framecrc -i $(SAMPLES)/bmp/test16.bmp -pix_fmt rgb555le + +FATE_BMP += fate-bmp-15bit-mask +fate-bmp-15bit-mask: CMD = framecrc -i $(SAMPLES)/bmp/test16bf555.bmp -pix_fmt rgb555le + +FATE_BMP += fate-bmp-16bit-mask +fate-bmp-16bit-mask: CMD = framecrc -i $(SAMPLES)/bmp/test16bf565.bmp -pix_fmt rgb565le + +FATE_BMP += fate-bmp-24bit +fate-bmp-24bit: CMD = framecrc -i $(SAMPLES)/bmp/test24.bmp + +FATE_BMP += fate-bmp-32bit +fate-bmp-32bit: CMD = framecrc -i $(SAMPLES)/bmp/test32.bmp -pix_fmt bgr24 + +FATE_BMP += fate-bmp-32bit-mask +fate-bmp-32bit-mask: CMD = framecrc -i $(SAMPLES)/bmp/test32bf.bmp -pix_fmt bgr24 + +FATE_BMP += fate-bmp-rle4 +fate-bmp-rle4: CMD = framecrc -i $(SAMPLES)/bmp/testcompress4.bmp -pix_fmt rgb24 + +FATE_BMP += fate-bmp-rle8 +fate-bmp-rle8: CMD = framecrc -i $(SAMPLES)/bmp/testcompress8.bmp -pix_fmt rgb24 + +FATE_TESTS += $(FATE_BMP) +fate-bmp: $(FATE_BMP) diff --git a/tests/ref/fate/bmp-15bit b/tests/ref/fate/bmp-15bit new file mode 100644 index 0000000000..a0f3bbf1db --- /dev/null +++ b/tests/ref/fate/bmp-15bit @@ -0,0 +1,2 @@ +#tb 0: 1/25 +0, 0, 0, 1, 16256, 0xdbcf881d diff --git a/tests/ref/fate/bmp-15bit-mask b/tests/ref/fate/bmp-15bit-mask new file mode 100644 index 0000000000..a0f3bbf1db --- /dev/null +++ b/tests/ref/fate/bmp-15bit-mask @@ -0,0 +1,2 @@ +#tb 0: 1/25 +0, 0, 0, 1, 16256, 0xdbcf881d diff --git a/tests/ref/fate/bmp-16bit-mask b/tests/ref/fate/bmp-16bit-mask new file mode 100644 index 0000000000..afa5ab4591 --- /dev/null +++ b/tests/ref/fate/bmp-16bit-mask @@ -0,0 +1,2 @@ +#tb 0: 1/25 +0, 0, 0, 1, 16256, 0x44675948 diff --git a/tests/ref/fate/bmp-1bit b/tests/ref/fate/bmp-1bit new file mode 100644 index 0000000000..1c825b1498 --- /dev/null +++ b/tests/ref/fate/bmp-1bit @@ -0,0 +1,2 @@ +#tb 0: 1/25 +0, 0, 0, 1, 24384, 0x4c968301 diff --git a/tests/ref/fate/bmp-24bit b/tests/ref/fate/bmp-24bit new file mode 100644 index 0000000000..8f1a615a9c --- /dev/null +++ b/tests/ref/fate/bmp-24bit @@ -0,0 +1,2 @@ +#tb 0: 1/25 +0, 0, 0, 1, 24384, 0x325dd8d9 diff --git a/tests/ref/fate/bmp-32bit b/tests/ref/fate/bmp-32bit new file mode 100644 index 0000000000..8f1a615a9c --- /dev/null +++ b/tests/ref/fate/bmp-32bit @@ -0,0 +1,2 @@ +#tb 0: 1/25 +0, 0, 0, 1, 24384, 0x325dd8d9 diff --git a/tests/ref/fate/bmp-32bit-mask b/tests/ref/fate/bmp-32bit-mask new file mode 100644 index 0000000000..8f1a615a9c --- /dev/null +++ b/tests/ref/fate/bmp-32bit-mask @@ -0,0 +1,2 @@ +#tb 0: 1/25 +0, 0, 0, 1, 24384, 0x325dd8d9 diff --git a/tests/ref/fate/bmp-4bit b/tests/ref/fate/bmp-4bit new file mode 100644 index 0000000000..c0eedf1948 --- /dev/null +++ b/tests/ref/fate/bmp-4bit @@ -0,0 +1,2 @@ +#tb 0: 1/25 +0, 0, 0, 1, 24384, 0x322d81f4 diff --git a/tests/ref/fate/bmp-4bit-os2 b/tests/ref/fate/bmp-4bit-os2 new file mode 100644 index 0000000000..8a5f6589c2 --- /dev/null +++ b/tests/ref/fate/bmp-4bit-os2 @@ -0,0 +1,2 @@ +#tb 0: 1/25 +0, 0, 0, 1, 19800, 0x563b599a diff --git a/tests/ref/fate/bmp-8bit b/tests/ref/fate/bmp-8bit new file mode 100644 index 0000000000..887113cdb5 --- /dev/null +++ b/tests/ref/fate/bmp-8bit @@ -0,0 +1,2 @@ +#tb 0: 1/25 +0, 0, 0, 1, 24384, 0xa7aa6b9b diff --git a/tests/ref/fate/bmp-8bit-os2 b/tests/ref/fate/bmp-8bit-os2 new file mode 100644 index 0000000000..887113cdb5 --- /dev/null +++ b/tests/ref/fate/bmp-8bit-os2 @@ -0,0 +1,2 @@ +#tb 0: 1/25 +0, 0, 0, 1, 24384, 0xa7aa6b9b diff --git a/tests/ref/fate/bmp-rle4 b/tests/ref/fate/bmp-rle4 new file mode 100644 index 0000000000..c0eedf1948 --- /dev/null +++ b/tests/ref/fate/bmp-rle4 @@ -0,0 +1,2 @@ +#tb 0: 1/25 +0, 0, 0, 1, 24384, 0x322d81f4 diff --git a/tests/ref/fate/bmp-rle8 b/tests/ref/fate/bmp-rle8 new file mode 100644 index 0000000000..887113cdb5 --- /dev/null +++ b/tests/ref/fate/bmp-rle8 @@ -0,0 +1,2 @@ +#tb 0: 1/25 +0, 0, 0, 1, 24384, 0xa7aa6b9b From f9888520cc853fe27cbe6f3827b2723c63299a4f Mon Sep 17 00:00:00 2001 From: Christophe GISQUET Date: Mon, 26 Mar 2012 02:29:09 +0200 Subject: [PATCH 06/11] vp8dsp x86: perform rounding shift with a single instruction Signed-off-by: Ronald S. Bultje --- libavcodec/x86/vp8dsp.asm | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/libavcodec/x86/vp8dsp.asm b/libavcodec/x86/vp8dsp.asm index 4cfeb3e330..82f21fefae 100644 --- a/libavcodec/x86/vp8dsp.asm +++ b/libavcodec/x86/vp8dsp.asm @@ -144,6 +144,8 @@ filter_h6_shuf1: db 0, 5, 1, 6, 2, 7, 3, 8, 4, 9, 5, 10, 6, 11, 7, 12 filter_h6_shuf2: db 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9 filter_h6_shuf3: db 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11 +pw_256: times 8 dw 256 + pw_20091: times 4 dw 20091 pw_17734: times 4 dw 17734 @@ -205,8 +207,7 @@ cglobal put_vp8_epel%1_h6, 6, 6 + npicregs, 8, dst, dststride, src, srcstride, h pmaddubsw m2, m7 paddsw m0, m1 paddsw m0, m2 - paddsw m0, [pw_64] - psraw m0, 7 + pmulhrsw m0, [pw_256] packuswb m0, m0 movh [dstq], m0 ; store @@ -219,7 +220,7 @@ cglobal put_vp8_epel%1_h6, 6, 6 + npicregs, 8, dst, dststride, src, srcstride, h cglobal put_vp8_epel%1_h4, 6, 6 + npicregs, 7, dst, dststride, src, srcstride, height, mx, picreg shl mxd, 4 - mova m2, [pw_64] + mova m2, [pw_256] mova m3, [filter_h2_shuf] mova m4, [filter_h4_shuf] %ifdef PIC @@ -235,9 +236,8 @@ cglobal put_vp8_epel%1_h4, 6, 6 + npicregs, 7, dst, dststride, src, srcstride, h pshufb m1, m4 pmaddubsw m0, m5 pmaddubsw m1, m6 - paddsw m0, m2 paddsw m0, m1 - psraw m0, 7 + pmulhrsw m0, m2 packuswb m0, m0 movh [dstq], m0 ; store @@ -255,7 +255,7 @@ cglobal put_vp8_epel%1_v4, 7, 7, 8, dst, dststride, src, srcstride, height, picr %endif mova m5, [fourtap_filter_hb+myq-16] mova m6, [fourtap_filter_hb+myq] - mova m7, [pw_64] + mova m7, [pw_256] ; read 3 lines sub srcq, srcstrideq @@ -275,8 +275,7 @@ cglobal put_vp8_epel%1_v4, 7, 7, 8, dst, dststride, src, srcstride, height, picr pmaddubsw m2, m6 paddsw m4, m2 mova m2, m3 - paddsw m4, m7 - psraw m4, 7 + pmulhrsw m4, m7 packuswb m4, m4 movh [dstq], m4 @@ -319,9 +318,8 @@ cglobal put_vp8_epel%1_v6, 7, 7, 8, dst, dststride, src, srcstride, height, picr paddsw m6, m1 paddsw m6, m7 mova m1, m2 - paddsw m6, [pw_64] mova m2, m3 - psraw m6, 7 + pmulhrsw m6, [pw_256] mova m3, m4 packuswb m6, m6 mova m4, m5 From cd88105f6fddf04fb04fe6c57cbaac5f6037c6a6 Mon Sep 17 00:00:00 2001 From: Christophe GISQUET Date: Mon, 19 Mar 2012 16:34:39 +0100 Subject: [PATCH 07/11] dsputil x86: remove deprecated parameter from scalarproduct_int16 prototype Signed-off-by: Ronald S. Bultje --- libavcodec/x86/dsputil_mmx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/x86/dsputil_mmx.c b/libavcodec/x86/dsputil_mmx.c index 040e37b38d..192c5c3b95 100644 --- a/libavcodec/x86/dsputil_mmx.c +++ b/libavcodec/x86/dsputil_mmx.c @@ -2576,9 +2576,9 @@ void ff_vp3_idct_put_sse2(uint8_t *dest, int line_size, DCTELEM *block); void ff_vp3_idct_add_sse2(uint8_t *dest, int line_size, DCTELEM *block); int32_t ff_scalarproduct_int16_mmx2(const int16_t *v1, const int16_t *v2, - int order, int shift); + int order); int32_t ff_scalarproduct_int16_sse2(const int16_t *v1, const int16_t *v2, - int order, int shift); + int order); int32_t ff_scalarproduct_and_madd_int16_mmx2(int16_t *v1, const int16_t *v2, const int16_t *v3, int order, int mul); From 6b81da2fd030dbc03d36b38558b58e8f0f667501 Mon Sep 17 00:00:00 2001 From: Christophe GISQUET Date: Wed, 21 Mar 2012 20:46:29 +0100 Subject: [PATCH 08/11] dsputil x86: use SSE float instruction instead of SSE2 integer equivalent All the more required since the users are pure SSE functions. Signed-off-by: Ronald S. Bultje --- libavcodec/x86/dsputil_yasm.asm | 2 +- libavcodec/x86/sbrdsp.asm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/x86/dsputil_yasm.asm b/libavcodec/x86/dsputil_yasm.asm index da08bdab50..00dc18b469 100644 --- a/libavcodec/x86/dsputil_yasm.asm +++ b/libavcodec/x86/dsputil_yasm.asm @@ -473,7 +473,7 @@ cglobal scalarproduct_float_sse, 3,3,2, v1, v2, offset shufps xmm0, xmm0, 1 addss xmm0, xmm1 %if ARCH_X86_64 == 0 - movd r0m, xmm0 + movss r0m, xmm0 fld dword r0m %endif RET diff --git a/libavcodec/x86/sbrdsp.asm b/libavcodec/x86/sbrdsp.asm index 6f66327088..47cb312140 100644 --- a/libavcodec/x86/sbrdsp.asm +++ b/libavcodec/x86/sbrdsp.asm @@ -68,7 +68,7 @@ cglobal sbr_sum_square, 2, 3, 6 shufps m0, m0, 1 addss m0, m1 %if ARCH_X86_64 == 0 - movd r0m, m0 + movss r0m, m0 fld dword r0m %endif RET From cfec77aaf8186f556e1201be13ce487b99b3b831 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 1 Apr 2012 18:56:26 +0200 Subject: [PATCH 09/11] configure: add dl to frei0r extralibs. --- configure | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure b/configure index 4606b236e3..e207ed82fe 100755 --- a/configure +++ b/configure @@ -1526,7 +1526,9 @@ cropdetect_filter_deps="gpl" delogo_filter_deps="gpl" drawtext_filter_deps="libfreetype" frei0r_filter_deps="frei0r dlopen strtok_r" +frei0r_filter_extralibs='$ldl' frei0r_src_filter_deps="frei0r dlopen strtok_r" +frei0r_src_filter_extralibs='$ldl' hqdn3d_filter_deps="gpl" ocv_filter_deps="libopencv" scale_filter_deps="swscale" From a03f8ea0a8c70b72acc9d8307f1bba0f35c1d36e Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 1 Apr 2012 15:18:00 +0200 Subject: [PATCH 10/11] vsrc_buffer: when no frame is available, return an error instead of segfaulting. --- libavfilter/vsrc_buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/vsrc_buffer.c b/libavfilter/vsrc_buffer.c index 665b33c1d4..dfe5bf5602 100644 --- a/libavfilter/vsrc_buffer.c +++ b/libavfilter/vsrc_buffer.c @@ -162,7 +162,7 @@ static int request_frame(AVFilterLink *link) if (!av_fifo_size(c->fifo)) { av_log(link->src, AV_LOG_ERROR, "request_frame() called with no available frame!\n"); - //return -1; + return AVERROR(EINVAL); } av_fifo_generic_read(c->fifo, &buf, sizeof(buf), NULL); From 0becb07842b57ea225ddf0726de33b5f8e669297 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Wed, 4 Apr 2012 14:53:25 +0200 Subject: [PATCH 11/11] h264: Factorize declaration of mb_sizes array. --- libavcodec/h264.c | 5 +++-- libavcodec/h264.h | 1 + libavcodec/h264_cabac.c | 4 ++-- libavcodec/h264_cavlc.c | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 6a1a8b696d..890dd223f3 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -45,6 +45,8 @@ // #undef NDEBUG #include +const uint16_t ff_h264_mb_sizes[4] = { 256, 384, 512, 768 }; + static const uint8_t rem6[QP_MAX_NUM + 1] = { 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, @@ -2138,12 +2140,11 @@ static av_always_inline void hl_decode_mb_internal(H264Context *h, int simple, if (!simple && IS_INTRA_PCM(mb_type)) { if (pixel_shift) { - static const uint16_t mb_sizes[4] = { 256, 384, 512, 768 }; const int bit_depth = h->sps.bit_depth_luma; int j; GetBitContext gb; init_get_bits(&gb, (uint8_t *)h->mb, - mb_sizes[h->sps.chroma_format_idc] * bit_depth); + ff_h264_mb_sizes[h->sps.chroma_format_idc] * bit_depth); for (i = 0; i < 16; i++) { uint16_t *tmp_y = (uint16_t *)(dest_y + i * linesize); diff --git a/libavcodec/h264.h b/libavcodec/h264.h index 99c46cc86a..ce06f613cd 100644 --- a/libavcodec/h264.h +++ b/libavcodec/h264.h @@ -584,6 +584,7 @@ typedef struct H264Context{ extern const uint8_t ff_h264_chroma_qp[3][QP_MAX_NUM+1]; ///< One chroma qp table for each supported bit depth (8, 9, 10). +extern const uint16_t ff_h264_mb_sizes[4]; /** * Decode SEI diff --git a/libavcodec/h264_cabac.c b/libavcodec/h264_cabac.c index 8b42f040ce..9e1cf1b520 100644 --- a/libavcodec/h264_cabac.c +++ b/libavcodec/h264_cabac.c @@ -1983,8 +1983,8 @@ decode_intra_mb: h->slice_table[ mb_xy ]= h->slice_num; if(IS_INTRA_PCM(mb_type)) { - static const uint16_t mb_sizes[4] = {256,384,512,768}; - const int mb_size = mb_sizes[h->sps.chroma_format_idc]*h->sps.bit_depth_luma >> 3; + const int mb_size = ff_h264_mb_sizes[h->sps.chroma_format_idc] * + h->sps.bit_depth_luma >> 3; const uint8_t *ptr; // We assume these blocks are very rare so we do not optimize it. diff --git a/libavcodec/h264_cavlc.c b/libavcodec/h264_cavlc.c index a5b6403446..c4159e241c 100644 --- a/libavcodec/h264_cavlc.c +++ b/libavcodec/h264_cavlc.c @@ -764,8 +764,8 @@ decode_intra_mb: if(IS_INTRA_PCM(mb_type)){ unsigned int x; - static const uint16_t mb_sizes[4] = {256,384,512,768}; - const int mb_size = mb_sizes[h->sps.chroma_format_idc]*h->sps.bit_depth_luma >> 3; + const int mb_size = ff_h264_mb_sizes[h->sps.chroma_format_idc] * + h->sps.bit_depth_luma >> 3; // We assume these blocks are very rare so we do not optimize it. align_get_bits(&s->gb);