[FFmpeg-cvslog] ffmpeg: Add a linebreak to an error message.

2017-02-27 Thread Carl Eugen Hoyos
ffmpeg | branch: master | Carl Eugen Hoyos  | Mon Feb 27 
10:28:00 2017 +0100| [f8d2079a67865771097938ddfed5972c453ad603] | committer: 
Carl Eugen Hoyos

ffmpeg: Add a linebreak to an error message.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f8d2079a67865771097938ddfed5972c453ad603
---

 ffmpeg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index 06570c0..38395e7 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -4428,7 +4428,7 @@ static int transcode(void)
 continue;
 }
 if ((ret = av_write_trailer(os)) < 0) {
-av_log(NULL, AV_LOG_ERROR, "Error writing trailer of %s: %s", 
os->filename, av_err2str(ret));
+av_log(NULL, AV_LOG_ERROR, "Error writing trailer of %s: %s\n", 
os->filename, av_err2str(ret));
 if (exit_on_error)
 exit_program(1);
 }

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avcodec/qdrw: fix decoding odd size images for 16bit case

2017-02-27 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Mon Feb 27 11:24:43 
2017 +0100| [05aa53dc553a9f824d81d7eaa0eb16b978264276] | committer: Paul B Mahol

avcodec/qdrw: fix decoding odd size images for 16bit case

Signed-off-by: Paul B Mahol 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=05aa53dc553a9f824d81d7eaa0eb16b978264276
---

 libavcodec/qdrw.c | 20 ++--
 1 file changed, 6 insertions(+), 14 deletions(-)

diff --git a/libavcodec/qdrw.c b/libavcodec/qdrw.c
index e650f49..e09872b 100644
--- a/libavcodec/qdrw.c
+++ b/libavcodec/qdrw.c
@@ -199,26 +199,18 @@ static int decode_rle16(AVCodecContext *avctx, AVFrame 
*p, GetByteContext *gbc)
 if (code & 0x80 ) { /* run */
 pix = bytestream2_get_be16(gbc);
 for (j = 0; j < 257 - code; j++) {
-out[pos] = pix;
-pos++;
-if (pos >= offset) {
-pos -= offset;
-pos++;
+if (pos < offset) {
+out[pos++] = pix;
 }
-if (pos >= offset)
-return AVERROR_INVALIDDATA;
 }
 left  -= 3;
 } else { /* copy */
 for (j = 0; j < code + 1; j++) {
-out[pos] = bytestream2_get_be16(gbc);
-pos++;
-if (pos >= offset) {
-pos -= offset;
-pos++;
+if (pos < offset) {
+out[pos++] = bytestream2_get_be16(gbc);
+} else {
+bytestream2_skip(gbc, 2);
 }
-if (pos >= offset)
-return AVERROR_INVALIDDATA;
 }
 left  -= 1 + (code + 1) * 2;
 }

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avcodec/qdrw: fix decoding odd size images for 2bpp and 4bpp

2017-02-27 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Mon Feb 27 11:39:36 
2017 +0100| [dc78696ea4b82b46e4c1a26e6bb1ebe0f4652101] | committer: Paul B Mahol

avcodec/qdrw: fix decoding odd size images for 2bpp and 4bpp

Signed-off-by: Paul B Mahol 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dc78696ea4b82b46e4c1a26e6bb1ebe0f4652101
---

 libavcodec/qdrw.c | 60 ++-
 1 file changed, 24 insertions(+), 36 deletions(-)

diff --git a/libavcodec/qdrw.c b/libavcodec/qdrw.c
index e09872b..11a0675 100644
--- a/libavcodec/qdrw.c
+++ b/libavcodec/qdrw.c
@@ -91,31 +91,27 @@ static int decode_rle_bpp2(AVCodecContext *avctx, AVFrame 
*p, GetByteContext *gb
 if (code & 0x80 ) { /* run */
 pix = bytestream2_get_byte(gbc);
 for (j = 0; j < 257 - code; j++) {
-out[pos++] = (pix & 0xC0) >> 6;
-out[pos++] = (pix & 0x30) >> 4;
-out[pos++] = (pix & 0x0C) >> 2;
-out[pos++] = (pix & 0x03);
-if (pos >= offset) {
-pos -= offset;
-pos++;
-}
-if (pos >= offset)
-return AVERROR_INVALIDDATA;
+if (pos < offset)
+out[pos++] = (pix & 0xC0) >> 6;
+if (pos < offset)
+out[pos++] = (pix & 0x30) >> 4;
+if (pos < offset)
+out[pos++] = (pix & 0x0C) >> 2;
+if (pos < offset)
+out[pos++] = (pix & 0x03);
 }
 left  -= 2;
 } else { /* copy */
 for (j = 0; j < code + 1; j++) {
 pix = bytestream2_get_byte(gbc);
-out[pos++] = (pix & 0xC0) >> 6;
-out[pos++] = (pix & 0x30) >> 4;
-out[pos++] = (pix & 0x0C) >> 2;
-out[pos++] = (pix & 0x03);
-if (pos >= offset) {
-pos -= offset;
-pos++;
-}
-if (pos >= offset)
-return AVERROR_INVALIDDATA;
+if (pos < offset)
+out[pos++] = (pix & 0xC0) >> 6;
+if (pos < offset)
+out[pos++] = (pix & 0x30) >> 4;
+if (pos < offset)
+out[pos++] = (pix & 0x0C) >> 2;
+if (pos < offset)
+out[pos++] = (pix & 0x03);
 }
 left  -= 1 + (code + 1);
 }
@@ -147,27 +143,19 @@ static int decode_rle_bpp4(AVCodecContext *avctx, AVFrame 
*p, GetByteContext *gb
 if (code & 0x80 ) { /* run */
 pix = bytestream2_get_byte(gbc);
 for (j = 0; j < 257 - code; j++) {
-out[pos++] = (pix & 0xF0) >> 4;
-out[pos++] = pix & 0xF;
-if (pos >= offset) {
-pos -= offset;
-pos++;
-}
-if (pos >= offset)
-return AVERROR_INVALIDDATA;
+if (pos < offset)
+out[pos++] = (pix & 0xF0) >> 4;
+if (pos < offset)
+out[pos++] = pix & 0xF;
 }
 left  -= 2;
 } else { /* copy */
 for (j = 0; j < code + 1; j++) {
 pix = bytestream2_get_byte(gbc);
-out[pos++] = (pix & 0xF0) >> 4;
-out[pos++] = pix & 0xF;
-if (pos >= offset) {
-pos -= offset;
-pos++;
-}
-if (pos >= offset)
-return AVERROR_INVALIDDATA;
+if (pos < offset)
+out[pos++] = (pix & 0xF0) >> 4;
+if (pos < offset)
+out[pos++] = pix & 0xF;
 }
 left  -= 1 + (code + 1);
 }

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avcodec/qdrw: fix decoding of odd sized images for 8bpp

2017-02-27 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Mon Feb 27 11:49:59 
2017 +0100| [1dcf91f2d360e266cd1c8349cc427d360f535918] | committer: Paul B Mahol

avcodec/qdrw: fix decoding of odd sized images for 8bpp

Signed-off-by: Paul B Mahol 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1dcf91f2d360e266cd1c8349cc427d360f535918
---

 libavcodec/qdrw.c | 14 ++
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/libavcodec/qdrw.c b/libavcodec/qdrw.c
index 11a0675..975e440 100644
--- a/libavcodec/qdrw.c
+++ b/libavcodec/qdrw.c
@@ -231,26 +231,24 @@ static int decode_rle(AVCodecContext *avctx, AVFrame *p, 
GetByteContext *gbc,
 if (code & 0x80 ) { /* run */
 pix = bytestream2_get_byte(gbc);
 for (j = 0; j < 257 - code; j++) {
-out[pos] = pix;
+if (pos < offset)
+out[pos] = pix;
 pos += step;
-if (pos >= offset) {
+if (pos >= offset && step > 1) {
 pos -= offset;
 pos++;
 }
-if (pos >= offset)
-return AVERROR_INVALIDDATA;
 }
 left  -= 2;
 } else { /* copy */
 for (j = 0; j < code + 1; j++) {
-out[pos] = bytestream2_get_byte(gbc);
+if (pos < offset)
+out[pos] = bytestream2_get_byte(gbc);
 pos += step;
-if (pos >= offset) {
+if (pos >= offset && step > 1) {
 pos -= offset;
 pos++;
 }
-if (pos >= offset)
-return AVERROR_INVALIDDATA;
 }
 left  -= 2 + code;
 }

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avcodec/qdrw: consume bytes when end is reached for 8bpp case

2017-02-27 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Mon Feb 27 12:04:15 
2017 +0100| [3a7f8d2a1f305fac97742c6aa5528c644e08e966] | committer: Paul B Mahol

avcodec/qdrw: consume bytes when end is reached for 8bpp case

This should really be part of previous commit.

Signed-off-by: Paul B Mahol 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3a7f8d2a1f305fac97742c6aa5528c644e08e966
---

 libavcodec/qdrw.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/qdrw.c b/libavcodec/qdrw.c
index 975e440..20e673a 100644
--- a/libavcodec/qdrw.c
+++ b/libavcodec/qdrw.c
@@ -242,8 +242,9 @@ static int decode_rle(AVCodecContext *avctx, AVFrame *p, 
GetByteContext *gbc,
 left  -= 2;
 } else { /* copy */
 for (j = 0; j < code + 1; j++) {
+pix = bytestream2_get_byte(gbc);
 if (pos < offset)
-out[pos] = bytestream2_get_byte(gbc);
+out[pos] = pix;
 pos += step;
 if (pos >= offset && step > 1) {
 pos -= offset;

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avcodec/h264: enable sse2 chroma deblock/loop filter functions

2017-02-27 Thread James Darnley
ffmpeg | branch: h264_assembly | James Darnley  | Wed Feb 22 
01:17:06 2017 +0100| [4deaf9e78a45e7d2ee9f8190edd16f3217c16d88] | committer: 
James Darnley

avcodec/h264: enable sse2 chroma deblock/loop filter functions

Between 1.00 and 1.16 times faster on Intel Yorkfield Core 2 Quad.
Between 1.11 and 1.39 times faster on Intel Kaby Lake Pentium.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4deaf9e78a45e7d2ee9f8190edd16f3217c16d88
---

 libavcodec/x86/h264_deblock.asm |  1 +
 libavcodec/x86/h264dsp_init.c   | 10 ++
 2 files changed, 11 insertions(+)

diff --git a/libavcodec/x86/h264_deblock.asm b/libavcodec/x86/h264_deblock.asm
index 32aa3d3..6702ae9 100644
--- a/libavcodec/x86/h264_deblock.asm
+++ b/libavcodec/x86/h264_deblock.asm
@@ -1252,6 +1252,7 @@ RET
 
 %endmacro ; DEBLOCK_CHROMA_XMM
 
+DEBLOCK_CHROMA_XMM sse2
 DEBLOCK_CHROMA_XMM avx
 
 ;-
diff --git a/libavcodec/x86/h264dsp_init.c b/libavcodec/x86/h264dsp_init.c
index 51082e8..0643b37 100644
--- a/libavcodec/x86/h264dsp_init.c
+++ b/libavcodec/x86/h264dsp_init.c
@@ -304,6 +304,16 @@ av_cold void ff_h264dsp_init_x86(H264DSPContext *c, const 
int bit_depth,
 #if ARCH_X86_64
 c->h264_h_loop_filter_luma_mbaff = ff_deblock_h_luma_mbaff_8_sse2;
 #endif
+
+c->h264_v_loop_filter_chroma   = ff_deblock_v_chroma_8_sse2;
+c->h264_v_loop_filter_chroma_intra = 
ff_deblock_v_chroma_intra_8_sse2;
+if (chroma_format_idc <= 1) {
+c->h264_h_loop_filter_chroma   = 
ff_deblock_h_chroma_8_sse2;
+c->h264_h_loop_filter_chroma_intra = 
ff_deblock_h_chroma_intra_8_sse2;
+} else {
+c->h264_h_loop_filter_chroma   = 
ff_deblock_h_chroma422_8_sse2;
+c->h264_h_loop_filter_chroma_intra = 
ff_deblock_h_chroma422_intra_8_sse2;
+}
 }
 if (EXTERNAL_SSSE3(cpu_flags)) {
 c->biweight_h264_pixels_tab[0] = ff_h264_biweight_16_ssse3;

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] lavc/svq3: Remove an unused function.

2017-02-27 Thread Carl Eugen Hoyos
ffmpeg | branch: master | Carl Eugen Hoyos  | Mon Feb 27 
13:10:41 2017 +0100| [1e298e77240099aa45bb8c955ee0313392227f42] | committer: 
Carl Eugen Hoyos

lavc/svq3: Remove an unused function.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1e298e77240099aa45bb8c955ee0313392227f42
---

 libavcodec/svq3.c | 5 -
 1 file changed, 5 deletions(-)

diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c
index 5b99656..06e3d37 100644
--- a/libavcodec/svq3.c
+++ b/libavcodec/svq3.c
@@ -629,11 +629,6 @@ static av_always_inline void 
hl_decode_mb_idct_luma(SVQ3Context *s,
 }
 }
 
-static av_always_inline int dctcoef_get(int16_t *mb, int index)
-{
-return AV_RN16A(mb + index);
-}
-
 static av_always_inline void hl_decode_mb_predict_luma(SVQ3Context *s,
int mb_type,
const int *block_offset,

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avcodec/h264: add avx 8-bit 4:2:0 chroma h deblock/loop filter

2017-02-27 Thread James Darnley
ffmpeg | branch: master | James Darnley  | Wed Feb 15 14:48:13 
2017 +0100| [ac096fc82df6aa8190f29a51ee5b589f318cfaa8] | committer: James 
Darnley

avcodec/h264: add avx 8-bit 4:2:0 chroma h deblock/loop filter

~1.14x faster (93 vs. 81 cycles) compared with mmxext function

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ac096fc82df6aa8190f29a51ee5b589f318cfaa8
---

 libavcodec/x86/h264_deblock.asm | 70 +
 libavcodec/x86/h264dsp_init.c   |  3 ++
 2 files changed, 73 insertions(+)

diff --git a/libavcodec/x86/h264_deblock.asm b/libavcodec/x86/h264_deblock.asm
index 2e84ca3..0465c9f 100644
--- a/libavcodec/x86/h264_deblock.asm
+++ b/libavcodec/x86/h264_deblock.asm
@@ -1059,6 +1059,54 @@ ff_chroma_intra_body_mmxext:
 paddb  m2, m6
 ret
 
+%macro LOAD_8_ROWS 8
+movd m0, %1
+movd m1, %2
+movd m2, %3
+movd m3, %4
+movd m4, %5
+movd m5, %6
+movd m6, %7
+movd m7, %8
+%endmacro
+
+%macro STORE_8_ROWS 8
+movd %1, m0
+movd %2, m1
+movd %3, m2
+movd %4, m3
+movd %5, m4
+movd %6, m5
+movd %7, m6
+movd %8, m7
+%endmacro
+
+%macro TRANSPOSE_8x4B_XMM 0
+punpcklbw m0, m1
+punpcklbw m2, m3
+punpcklbw m4, m5
+punpcklbw m6, m7
+punpcklwd m0, m2
+punpcklwd m4, m6
+punpckhdq m2, m0, m4
+punpckldq m0, m4
+MOVHL m1, m0
+MOVHL m3, m2
+%endmacro
+
+%macro TRANSPOSE_4x8B_XMM 0
+punpcklbw m0, m1
+punpcklbw m2, m3
+punpckhwd m4, m0, m2
+punpcklwd m0, m2
+MOVHL m6, m4
+MOVHL m2, m0
+pshufd m1, m0, 1
+pshufd m3, m2, 1
+pshufd m5, m4, 1
+pshufd m7, m6, 1
+%endmacro
+
 %macro CHROMA_INTER_BODY_XMM 1
 LOAD_MASK alpha_d, beta_d
 movd m6, [tc0_q]
@@ -1078,6 +1126,15 @@ ff_chroma_intra_body_mmxext:
 sub %1, stride_q
 %endmacro
 
+%macro CHROMA_H_START_XMM 2
+movsxdifnidn stride_q, stride_d
+dec alpha_d
+dec beta_d
+lea %2, [3*stride_q]
+mov %1,  pix_q
+add %1,  %2
+%endmacro
+
 %macro DEBLOCK_CHROMA_XMM 1
 
 INIT_XMM %1
@@ -1093,6 +1150,19 @@ cglobal deblock_v_chroma_8, 5, 6, 8, pix_, stride_, 
alpha_, beta_, tc0_
 movq [pix_q], m2
 RET
 
+cglobal deblock_h_chroma_8, 5, 7, 8, 0-16, pix_, stride_, alpha_, beta_, tc0_
+CHROMA_H_START_XMM r5, r6
+LOAD_8_ROWS PASS8ROWS(pix_q - 2, r5 - 2, stride_q, r6)
+TRANSPOSE_8x4B_XMM
+movq [rsp], m0
+movq [rsp + 8], m3
+CHROMA_INTER_BODY_XMM 1
+movq m0, [rsp]
+movq m3, [rsp + 8]
+TRANSPOSE_4x8B_XMM
+STORE_8_ROWS PASS8ROWS(pix_q - 2, r5 - 2, stride_q, r6)
+RET
+
 %endmacro ; DEBLOCK_CHROMA_XMM
 
 DEBLOCK_CHROMA_XMM avx
diff --git a/libavcodec/x86/h264dsp_init.c b/libavcodec/x86/h264dsp_init.c
index 6794aa5..0b15471 100644
--- a/libavcodec/x86/h264dsp_init.c
+++ b/libavcodec/x86/h264dsp_init.c
@@ -319,6 +319,9 @@ av_cold void ff_h264dsp_init_x86(H264DSPContext *c, const 
int bit_depth,
 #endif
 
 c->h264_v_loop_filter_chroma   = ff_deblock_v_chroma_8_avx;
+if (chroma_format_idc <= 1) {
+c->h264_h_loop_filter_chroma   = ff_deblock_h_chroma_8_avx;
+}
 }
 } else if (bit_depth == 10) {
 if (EXTERNAL_MMXEXT(cpu_flags)) {

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avcodec/h264: add avx 8-bit chroma v intra deblock/loop filter

2017-02-27 Thread James Darnley
ffmpeg | branch: master | James Darnley  | Wed Feb 15 14:59:46 
2017 +0100| [987ffe4b8dce88b8df12208eef788bd022a43598] | committer: James 
Darnley

avcodec/h264: add avx 8-bit chroma v intra deblock/loop filter

~1.14x faster (90 vs 78 cycles) compared with mmxext

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=987ffe4b8dce88b8df12208eef788bd022a43598
---

 libavcodec/x86/h264_deblock.asm | 33 +
 libavcodec/x86/h264dsp_init.c   |  1 +
 2 files changed, 34 insertions(+)

diff --git a/libavcodec/x86/h264_deblock.asm b/libavcodec/x86/h264_deblock.asm
index e2eb002..1e6d822 100644
--- a/libavcodec/x86/h264_deblock.asm
+++ b/libavcodec/x86/h264_deblock.asm
@@ -1117,6 +1117,28 @@ ff_chroma_intra_body_mmxext:
 DEBLOCK_P0_Q0
 %endmacro
 
+%macro CHROMA_INTRA_BODY_XMM 0
+LOAD_MASK alpha_d, beta_d
+movam5,  m1
+movam6,  m2
+pxorm4,  m1, m3
+pandm4, [pb_1]
+pavgb   m1,  m3
+psubusb m1,  m4
+pavgb   m1,  m0
+pxorm4,  m2, m0
+pandm4, [pb_1]
+pavgb   m2,  m0
+psubusb m2,  m4
+pavgb   m2,  m3
+psubb   m1,  m5
+psubb   m2,  m6
+pandm1,  m7
+pandm2,  m7
+paddb   m1,  m5
+paddb   m2,  m6
+%endmacro
+
 %macro CHROMA_V_START_XMM 1
 movsxdifnidn stride_q, stride_d
 dec alpha_d
@@ -1190,6 +1212,17 @@ cglobal deblock_h_chroma422_8, 5, 7, 8, 0-16, pix_, 
stride_, alpha_, beta_, tc0_
 STORE_8_ROWS PASS8ROWS(pix_q - 2, r5 - 2, stride_q, r6)
 RET
 
+cglobal deblock_v_chroma_intra_8, 4, 5, 8, pix_, stride_, alpha_, beta_
+CHROMA_V_START_XMM r4
+movq m0, [r4]
+movq m1, [r4 + stride_q]
+movq m2, [pix_q]
+movq m3, [pix_q + stride_q]
+CHROMA_INTRA_BODY_XMM
+movq [r4 + stride_q], m1
+movq [pix_q], m2
+RET
+
 %endmacro ; DEBLOCK_CHROMA_XMM
 
 DEBLOCK_CHROMA_XMM avx
diff --git a/libavcodec/x86/h264dsp_init.c b/libavcodec/x86/h264dsp_init.c
index 6073932..cc86664 100644
--- a/libavcodec/x86/h264dsp_init.c
+++ b/libavcodec/x86/h264dsp_init.c
@@ -319,6 +319,7 @@ av_cold void ff_h264dsp_init_x86(H264DSPContext *c, const 
int bit_depth,
 #endif
 
 c->h264_v_loop_filter_chroma   = ff_deblock_v_chroma_8_avx;
+c->h264_v_loop_filter_chroma_intra = 
ff_deblock_v_chroma_intra_8_avx;
 if (chroma_format_idc <= 1) {
 c->h264_h_loop_filter_chroma   = ff_deblock_h_chroma_8_avx;
 } else {

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avcodec/h264: add avx 8-bit chroma v deblock/loop filter

2017-02-27 Thread James Darnley
ffmpeg | branch: master | James Darnley  | Wed Feb 15 14:36:20 
2017 +0100| [5c56758843eb5ea8fc39177585a57606a34125bc] | committer: James 
Darnley

avcodec/h264: add avx 8-bit chroma v deblock/loop filter

~1.24x faster (101 vs. 81 cycles) compared with mmxext function

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5c56758843eb5ea8fc39177585a57606a34125bc
---

 libavcodec/x86/h264_deblock.asm | 38 ++
 libavcodec/x86/h264dsp_init.c   |  2 ++
 2 files changed, 40 insertions(+)

diff --git a/libavcodec/x86/h264_deblock.asm b/libavcodec/x86/h264_deblock.asm
index 93caa67..2e84ca3 100644
--- a/libavcodec/x86/h264_deblock.asm
+++ b/libavcodec/x86/h264_deblock.asm
@@ -1059,6 +1059,44 @@ ff_chroma_intra_body_mmxext:
 paddb  m2, m6
 ret
 
+%macro CHROMA_INTER_BODY_XMM 1
+LOAD_MASK alpha_d, beta_d
+movd m6, [tc0_q]
+%rep %1
+punpcklbw m6, m6
+%endrep
+pand m7, m6
+DEBLOCK_P0_Q0
+%endmacro
+
+%macro CHROMA_V_START_XMM 1
+movsxdifnidn stride_q, stride_d
+dec alpha_d
+dec beta_d
+mov %1, pix_q
+sub %1, stride_q
+sub %1, stride_q
+%endmacro
+
+%macro DEBLOCK_CHROMA_XMM 1
+
+INIT_XMM %1
+
+cglobal deblock_v_chroma_8, 5, 6, 8, pix_, stride_, alpha_, beta_, tc0_
+CHROMA_V_START_XMM r5
+movq m0, [r5]
+movq m1, [r5 + stride_q]
+movq m2, [pix_q]
+movq m3, [pix_q + stride_q]
+CHROMA_INTER_BODY_XMM 1
+movq [r5 + stride_q], m1
+movq [pix_q], m2
+RET
+
+%endmacro ; DEBLOCK_CHROMA_XMM
+
+DEBLOCK_CHROMA_XMM avx
+
 ;-
 ; void ff_h264_loop_filter_strength(int16_t bs[2][4][4], uint8_t nnz[40],
 ;   int8_t ref[2][40], int16_t mv[2][40][2],
diff --git a/libavcodec/x86/h264dsp_init.c b/libavcodec/x86/h264dsp_init.c
index 10f1940..6794aa5 100644
--- a/libavcodec/x86/h264dsp_init.c
+++ b/libavcodec/x86/h264dsp_init.c
@@ -317,6 +317,8 @@ av_cold void ff_h264dsp_init_x86(H264DSPContext *c, const 
int bit_depth,
 #if ARCH_X86_64
 c->h264_h_loop_filter_luma_mbaff = ff_deblock_h_luma_mbaff_8_avx;
 #endif
+
+c->h264_v_loop_filter_chroma   = ff_deblock_v_chroma_8_avx;
 }
 } else if (bit_depth == 10) {
 if (EXTERNAL_MMXEXT(cpu_flags)) {

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avcodec/h264: enable sse2 chroma deblock/loop filter functions

2017-02-27 Thread James Darnley
ffmpeg | branch: master | James Darnley  | Wed Feb 22 01:17:06 
2017 +0100| [33de0fee2c33c492aae96f643ed7bbaa393043dc] | committer: James 
Darnley

avcodec/h264: enable sse2 chroma deblock/loop filter functions

Between 1.00 and 1.16 times faster on Intel Yorkfield Core 2 Quad.
Between 1.11 and 1.39 times faster on Intel Kaby Lake Pentium.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=33de0fee2c33c492aae96f643ed7bbaa393043dc
---

 libavcodec/x86/h264_deblock.asm |  1 +
 libavcodec/x86/h264dsp_init.c   | 10 ++
 2 files changed, 11 insertions(+)

diff --git a/libavcodec/x86/h264_deblock.asm b/libavcodec/x86/h264_deblock.asm
index 32aa3d3..6702ae9 100644
--- a/libavcodec/x86/h264_deblock.asm
+++ b/libavcodec/x86/h264_deblock.asm
@@ -1252,6 +1252,7 @@ RET
 
 %endmacro ; DEBLOCK_CHROMA_XMM
 
+DEBLOCK_CHROMA_XMM sse2
 DEBLOCK_CHROMA_XMM avx
 
 ;-
diff --git a/libavcodec/x86/h264dsp_init.c b/libavcodec/x86/h264dsp_init.c
index 51082e8..0643b37 100644
--- a/libavcodec/x86/h264dsp_init.c
+++ b/libavcodec/x86/h264dsp_init.c
@@ -304,6 +304,16 @@ av_cold void ff_h264dsp_init_x86(H264DSPContext *c, const 
int bit_depth,
 #if ARCH_X86_64
 c->h264_h_loop_filter_luma_mbaff = ff_deblock_h_luma_mbaff_8_sse2;
 #endif
+
+c->h264_v_loop_filter_chroma   = ff_deblock_v_chroma_8_sse2;
+c->h264_v_loop_filter_chroma_intra = 
ff_deblock_v_chroma_intra_8_sse2;
+if (chroma_format_idc <= 1) {
+c->h264_h_loop_filter_chroma   = 
ff_deblock_h_chroma_8_sse2;
+c->h264_h_loop_filter_chroma_intra = 
ff_deblock_h_chroma_intra_8_sse2;
+} else {
+c->h264_h_loop_filter_chroma   = 
ff_deblock_h_chroma422_8_sse2;
+c->h264_h_loop_filter_chroma_intra = 
ff_deblock_h_chroma422_intra_8_sse2;
+}
 }
 if (EXTERNAL_SSSE3(cpu_flags)) {
 c->biweight_h264_pixels_tab[0] = ff_h264_biweight_16_ssse3;

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avcodec/h264: add avx 8-bit 4:2:0 chroma h intra deblock/loop filter

2017-02-27 Thread James Darnley
ffmpeg | branch: master | James Darnley  | Wed Feb 15 15:03:18 
2017 +0100| [0e16b3e2be3a3e20a5da94a0c48049ba6a5baacd] | committer: James 
Darnley

avcodec/h264: add avx 8-bit 4:2:0 chroma h intra deblock/loop filter

~1.10x faster (69 vs. 63 cycles) compared to mmxext function

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0e16b3e2be3a3e20a5da94a0c48049ba6a5baacd
---

 libavcodec/x86/h264_deblock.asm | 9 +
 libavcodec/x86/h264dsp_init.c   | 1 +
 2 files changed, 10 insertions(+)

diff --git a/libavcodec/x86/h264_deblock.asm b/libavcodec/x86/h264_deblock.asm
index 1e6d822..2197608 100644
--- a/libavcodec/x86/h264_deblock.asm
+++ b/libavcodec/x86/h264_deblock.asm
@@ -1223,6 +1223,15 @@ cglobal deblock_v_chroma_intra_8, 4, 5, 8, pix_, 
stride_, alpha_, beta_
 movq [pix_q], m2
 RET
 
+cglobal deblock_h_chroma_intra_8, 4, 6, 8, pix_, stride_, alpha_, beta_
+CHROMA_H_START_XMM r4, r5
+LOAD_8_ROWS PASS8ROWS(pix_q - 2, r4 - 2, stride_q, r5)
+TRANSPOSE_8x4B_XMM
+CHROMA_INTRA_BODY_XMM
+TRANSPOSE_4x8B_XMM
+STORE_8_ROWS PASS8ROWS(pix_q - 2, r4 - 2, stride_q, r5)
+RET
+
 %endmacro ; DEBLOCK_CHROMA_XMM
 
 DEBLOCK_CHROMA_XMM avx
diff --git a/libavcodec/x86/h264dsp_init.c b/libavcodec/x86/h264dsp_init.c
index cc86664..b1246d0 100644
--- a/libavcodec/x86/h264dsp_init.c
+++ b/libavcodec/x86/h264dsp_init.c
@@ -322,6 +322,7 @@ av_cold void ff_h264dsp_init_x86(H264DSPContext *c, const 
int bit_depth,
 c->h264_v_loop_filter_chroma_intra = 
ff_deblock_v_chroma_intra_8_avx;
 if (chroma_format_idc <= 1) {
 c->h264_h_loop_filter_chroma   = ff_deblock_h_chroma_8_avx;
+c->h264_h_loop_filter_chroma_intra = 
ff_deblock_h_chroma_intra_8_avx;
 } else {
 c->h264_h_loop_filter_chroma   = 
ff_deblock_h_chroma422_8_avx;
 }

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avcodec/h264: add avx 8-bit 4:2:2 chroma h intra deblock/loop filter

2017-02-27 Thread James Darnley
ffmpeg | branch: master | James Darnley  | Wed Feb 15 15:05:42 
2017 +0100| [cd893b9307b8c871fec067928dc613fa987e38c3] | committer: James 
Darnley

avcodec/h264: add avx 8-bit 4:2:2 chroma h intra deblock/loop filter

~1.37x faster (147 vs. 108 cycles) compared to mmxext function

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cd893b9307b8c871fec067928dc613fa987e38c3
---

 libavcodec/x86/h264_deblock.asm | 18 ++
 libavcodec/x86/h264dsp_init.c   |  1 +
 2 files changed, 19 insertions(+)

diff --git a/libavcodec/x86/h264_deblock.asm b/libavcodec/x86/h264_deblock.asm
index 2197608..32aa3d3 100644
--- a/libavcodec/x86/h264_deblock.asm
+++ b/libavcodec/x86/h264_deblock.asm
@@ -1232,6 +1232,24 @@ cglobal deblock_h_chroma_intra_8, 4, 6, 8, pix_, 
stride_, alpha_, beta_
 STORE_8_ROWS PASS8ROWS(pix_q - 2, r4 - 2, stride_q, r5)
 RET
 
+cglobal deblock_h_chroma422_intra_8, 4, 6, 8, pix_, stride_, alpha_, beta_
+CHROMA_H_START_XMM r4, r5
+LOAD_8_ROWS PASS8ROWS(pix_q - 2, r4 - 2, stride_q, r5)
+TRANSPOSE_8x4B_XMM
+CHROMA_INTRA_BODY_XMM
+TRANSPOSE_4x8B_XMM
+STORE_8_ROWS PASS8ROWS(pix_q - 2, r4 - 2, stride_q, r5)
+
+lea pix_q, [pix_q + 8*stride_q]
+lea r4,[r4+ 8*stride_q]
+
+LOAD_8_ROWS PASS8ROWS(pix_q - 2, r4 - 2, stride_q, r5)
+TRANSPOSE_8x4B_XMM
+CHROMA_INTRA_BODY_XMM
+TRANSPOSE_4x8B_XMM
+STORE_8_ROWS PASS8ROWS(pix_q - 2, r4 - 2, stride_q, r5)
+RET
+
 %endmacro ; DEBLOCK_CHROMA_XMM
 
 DEBLOCK_CHROMA_XMM avx
diff --git a/libavcodec/x86/h264dsp_init.c b/libavcodec/x86/h264dsp_init.c
index b1246d0..51082e8 100644
--- a/libavcodec/x86/h264dsp_init.c
+++ b/libavcodec/x86/h264dsp_init.c
@@ -325,6 +325,7 @@ av_cold void ff_h264dsp_init_x86(H264DSPContext *c, const 
int bit_depth,
 c->h264_h_loop_filter_chroma_intra = 
ff_deblock_h_chroma_intra_8_avx;
 } else {
 c->h264_h_loop_filter_chroma   = 
ff_deblock_h_chroma422_8_avx;
+c->h264_h_loop_filter_chroma_intra = 
ff_deblock_h_chroma422_intra_8_avx;
 }
 }
 } else if (bit_depth == 10) {

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avcodec/h264: add avx 8-bit 4:2:2 chroma h deblock/loop filter

2017-02-27 Thread James Darnley
ffmpeg | branch: master | James Darnley  | Wed Feb 15 14:54:11 
2017 +0100| [88307b3eec018b86f6adfddeb6e9b384c95b7ca6] | committer: James 
Darnley

avcodec/h264: add avx 8-bit 4:2:2 chroma h deblock/loop filter

~1.21x faster (68 vs. 56 cycles) compared with mmxext function

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=88307b3eec018b86f6adfddeb6e9b384c95b7ca6
---

 libavcodec/x86/h264_deblock.asm | 27 +++
 libavcodec/x86/h264dsp_init.c   |  2 ++
 2 files changed, 29 insertions(+)

diff --git a/libavcodec/x86/h264_deblock.asm b/libavcodec/x86/h264_deblock.asm
index 0465c9f..e2eb002 100644
--- a/libavcodec/x86/h264_deblock.asm
+++ b/libavcodec/x86/h264_deblock.asm
@@ -1163,6 +1163,33 @@ cglobal deblock_h_chroma_8, 5, 7, 8, 0-16, pix_, 
stride_, alpha_, beta_, tc0_
 STORE_8_ROWS PASS8ROWS(pix_q - 2, r5 - 2, stride_q, r6)
 RET
 
+cglobal deblock_h_chroma422_8, 5, 7, 8, 0-16, pix_, stride_, alpha_, beta_, 
tc0_,
+CHROMA_H_START_XMM r5, r6
+LOAD_8_ROWS PASS8ROWS(pix_q - 2, r5 - 2, stride_q, r6)
+TRANSPOSE_8x4B_XMM
+movq [rsp], m0
+movq [rsp + 8], m3
+CHROMA_INTER_BODY_XMM 2
+movq m0, [rsp]
+movq m3, [rsp + 8]
+TRANSPOSE_4x8B_XMM
+STORE_8_ROWS PASS8ROWS(pix_q - 2, r5 - 2, stride_q, r6)
+
+lea pix_q, [pix_q + 8*stride_q]
+lea r5,[r5+ 8*stride_q]
+add tc0_q,  2
+
+LOAD_8_ROWS PASS8ROWS(pix_q - 2, r5 - 2, stride_q, r6)
+TRANSPOSE_8x4B_XMM
+movq [rsp], m0
+movq [rsp + 8], m3
+CHROMA_INTER_BODY_XMM 2
+movq m0, [rsp]
+movq m3, [rsp + 8]
+TRANSPOSE_4x8B_XMM
+STORE_8_ROWS PASS8ROWS(pix_q - 2, r5 - 2, stride_q, r6)
+RET
+
 %endmacro ; DEBLOCK_CHROMA_XMM
 
 DEBLOCK_CHROMA_XMM avx
diff --git a/libavcodec/x86/h264dsp_init.c b/libavcodec/x86/h264dsp_init.c
index 0b15471..6073932 100644
--- a/libavcodec/x86/h264dsp_init.c
+++ b/libavcodec/x86/h264dsp_init.c
@@ -321,6 +321,8 @@ av_cold void ff_h264dsp_init_x86(H264DSPContext *c, const 
int bit_depth,
 c->h264_v_loop_filter_chroma   = ff_deblock_v_chroma_8_avx;
 if (chroma_format_idc <= 1) {
 c->h264_h_loop_filter_chroma   = ff_deblock_h_chroma_8_avx;
+} else {
+c->h264_h_loop_filter_chroma   = 
ff_deblock_h_chroma422_8_avx;
 }
 }
 } else if (bit_depth == 10) {

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avcodec/scpr: check if total_freq is 0 in decode0

2017-02-27 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Mon Feb 27 13:50:08 
2017 +0100| [86ab6b6e08e2982fb5785e0691c0a7e289339ffb] | committer: Paul B Mahol

avcodec/scpr: check if total_freq is 0 in decode0

Fixes SIGFPE, closes #6196.

Signed-off-by: Paul B Mahol 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=86ab6b6e08e2982fb5785e0691c0a7e289339ffb
---

 libavcodec/scpr.c | 25 +++--
 1 file changed, 19 insertions(+), 6 deletions(-)

diff --git a/libavcodec/scpr.c b/libavcodec/scpr.c
index d5ce8c7..031ce51 100644
--- a/libavcodec/scpr.c
+++ b/libavcodec/scpr.c
@@ -63,7 +63,7 @@ typedef struct SCPRContext {
 int cxshift;
 
 int   (*get_freq)(RangeCoder *rc, unsigned total_freq, unsigned 
*freq);
-void  (*decode)(GetByteContext *gb, RangeCoder *rc, unsigned 
cumFreq, unsigned freq, unsigned total_freq);
+int   (*decode)(GetByteContext *gb, RangeCoder *rc, unsigned 
cumFreq, unsigned freq, unsigned total_freq);
 } SCPRContext;
 
 static void init_rangecoder(RangeCoder *rc, GetByteContext *gb)
@@ -130,7 +130,7 @@ static void reinit_tables(SCPRContext *s)
 s->mv_model[1][512] = 512;
 }
 
-static void decode(GetByteContext *gb, RangeCoder *rc, unsigned cumFreq, 
unsigned freq, unsigned total_freq)
+static int decode(GetByteContext *gb, RangeCoder *rc, unsigned cumFreq, 
unsigned freq, unsigned total_freq)
 {
 rc->code -= cumFreq * rc->range;
 rc->range *= freq;
@@ -140,6 +140,8 @@ static void decode(GetByteContext *gb, RangeCoder *rc, 
unsigned cumFreq, unsigne
 rc->code = (rc->code << 8) | byte;
 rc->range <<= 8;
 }
+
+return 0;
 }
 
 static int get_freq(RangeCoder *rc, unsigned total_freq, unsigned *freq)
@@ -157,9 +159,14 @@ static int get_freq(RangeCoder *rc, unsigned total_freq, 
unsigned *freq)
 return 0;
 }
 
-static void decode0(GetByteContext *gb, RangeCoder *rc, unsigned cumFreq, 
unsigned freq, unsigned total_freq)
+static int decode0(GetByteContext *gb, RangeCoder *rc, unsigned cumFreq, 
unsigned freq, unsigned total_freq)
 {
-int t = rc->range * (uint64_t)cumFreq / total_freq;
+int t;
+
+if (total_freq == 0)
+return AVERROR_INVALIDDATA;
+
+t = rc->range * (uint64_t)cumFreq / total_freq;
 
 rc->code1 += t + 1;
 rc->range = rc->range * (uint64_t)(freq + cumFreq) / total_freq - (t + 1);
@@ -170,6 +177,8 @@ static void decode0(GetByteContext *gb, RangeCoder *rc, 
unsigned cumFreq, unsign
 rc->code1 <<= 8;
 rc->range <<= 8;
 }
+
+return 0;
 }
 
 static int get_freq0(RangeCoder *rc, unsigned total_freq, unsigned *freq)
@@ -202,7 +211,8 @@ static int decode_value(SCPRContext *s, unsigned *cnt, 
unsigned maxc, unsigned s
 break;
 c++;
 }
-s->decode(gb, rc, cumfr, cnt_c, totfr);
+if ((ret = s->decode(gb, rc, cumfr, cnt_c, totfr)) < 0)
+return ret;
 
 cnt[c] = cnt_c + step;
 totfr += step;
@@ -251,7 +261,10 @@ static int decode_unit(SCPRContext *s, PixelModel *pixel, 
unsigned step, unsigne
 break;
 c++;
 }
-s->decode(gb, rc, cumfr, cnt_c, totfr);
+
+if ((ret = s->decode(gb, rc, cumfr, cnt_c, totfr)) < 0)
+return ret;
+
 pixel->freq[c] = cnt_c + step;
 pixel->lookup[x] = cnt_x + step;
 totfr += step;

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avcodec/qdrw: check bytes per scanline for 2bpp images

2017-02-27 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Mon Feb 27 14:15:11 
2017 +0100| [26a7d6a301b9b6c67153c87d42db145cdc0e57cf] | committer: Paul B Mahol

avcodec/qdrw: check bytes per scanline for 2bpp images

One byte less is read in case of small width.
Closes #6194.

Signed-off-by: Paul B Mahol 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=26a7d6a301b9b6c67153c87d42db145cdc0e57cf
---

 libavcodec/qdrw.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavcodec/qdrw.c b/libavcodec/qdrw.c
index 20e673a..c92cd85 100644
--- a/libavcodec/qdrw.c
+++ b/libavcodec/qdrw.c
@@ -81,7 +81,10 @@ static int decode_rle_bpp2(AVCodecContext *avctx, AVFrame 
*p, GetByteContext *gb
 int pos = 0;
 
 /* size of packed line */
-size = left = bytestream2_get_be16(gbc);
+if (offset / 4 > 200)
+size = left = bytestream2_get_be16(gbc);
+else
+size = left = bytestream2_get_byte(gbc);
 if (bytestream2_get_bytes_left(gbc) < size)
 return AVERROR_INVALIDDATA;
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avcodec/dca: Fix multiple runtime error: signed integer overflow

2017-02-27 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sun 
Feb 26 20:28:02 2017 +0100| [949d2176ef0a37c6ecbb65be0f1199536a2d9278] | 
committer: Michael Niedermayer

avcodec/dca: Fix multiple runtime error: signed integer overflow

Fixes: 680/clusterfuzz-testcase-5416627266912256
Fixes: 681/clusterfuzz-testcase-5013323462475776

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=949d2176ef0a37c6ecbb65be0f1199536a2d9278
---

 libavcodec/dca_xll.c | 4 ++--
 libavcodec/dcadsp.c  | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/dca_xll.c b/libavcodec/dca_xll.c
index 3dfde6b..6cebda3 100644
--- a/libavcodec/dca_xll.c
+++ b/libavcodec/dca_xll.c
@@ -652,7 +652,7 @@ static void chs_filter_band_data(DCAXllDecoder *s, 
DCAXllChSet *c, int band)
 int64_t err = 0;
 for (k = 0; k < order; k++)
 err += (int64_t)buf[j + k] * coeff[order - k - 1];
-buf[j + k] -= clip23(norm16(err));
+buf[j + k] -= (SUINT)clip23(norm16(err));
 }
 } else {
 // Inverse fixed coefficient prediction
@@ -1308,7 +1308,7 @@ static int combine_residual_frame(DCAXllDecoder *s, 
DCAXllChSet *c)
 // Undo embedded core downmix pre-scaling
 int scale_inv = o->dmix_scale_inv[c->hier_ofs + ch];
 for (n = 0; n < nsamples; n++)
-dst[n] += clip23((mul16(src[n], scale_inv) + round) >> shift);
+dst[n] += (SUINT)clip23((mul16(src[n], scale_inv) + round) >> 
shift);
 } else {
 // No downmix scaling
 for (n = 0; n < nsamples; n++)
diff --git a/libavcodec/dcadsp.c b/libavcodec/dcadsp.c
index 3d637f6..1503d00 100644
--- a/libavcodec/dcadsp.c
+++ b/libavcodec/dcadsp.c
@@ -300,7 +300,7 @@ static void decor_c(int32_t *dst, const int32_t *src, int 
coeff, ptrdiff_t len)
 int i;
 
 for (i = 0; i < len; i++)
-dst[i] += (int)(src[i] * (SUINT)coeff + (1 << 2)) >> 3;
+dst[i] += (SUINT)((int)(src[i] * (SUINT)coeff + (1 << 2)) >> 3);
 }
 
 static void dmix_sub_xch_c(int32_t *dst1, int32_t *dst2,

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avcodec/mpeg4videodec: Fix runtime error: left shift of negative value -2650

2017-02-27 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sun 
Feb 26 20:27:59 2017 +0100| [25e93aacc2142f3b57f1e63c67ca46d304f154ef] | 
committer: Michael Niedermayer

avcodec/mpeg4videodec: Fix runtime error: left shift of negative value -2650

Fixes: 674/clusterfuzz-testcase-6713275880308736

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=25e93aacc2142f3b57f1e63c67ca46d304f154ef
---

 libavcodec/mpeg4videodec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index dac9538..9f9374d 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -283,12 +283,12 @@ static int mpeg4_decode_sprite_trajectory(Mpeg4DecContext 
*ctx, GetBitContext *g
 ctx->sprite_shift[1]   = 0;
 break;
 case 2:
-s->sprite_offset[0][0] = (sprite_ref[0][0] << (alpha + rho)) +
+s->sprite_offset[0][0] = (sprite_ref[0][0] * (1 << alpha + rho)) +
  (-r * sprite_ref[0][0] + virtual_ref[0][0]) *
  (-vop_ref[0][0]) +
  (r * sprite_ref[0][1] - virtual_ref[0][1]) *
  (-vop_ref[0][1]) + (1 << (alpha + rho - 1));
-s->sprite_offset[0][1] = (sprite_ref[0][1] << (alpha + rho)) +
+s->sprite_offset[0][1] = (sprite_ref[0][1] * (1 << alpha + rho)) +
  (-r * sprite_ref[0][1] + virtual_ref[0][1]) *
  (-vop_ref[0][0]) +
  (-r * sprite_ref[0][0] + virtual_ref[0][0]) *

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avcodec/pictordec: Check plane value before doing value/mask computations

2017-02-27 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sun 
Feb 26 20:28:00 2017 +0100| [63e400a8807dca7b0ffa3841df2e31f7419abb8d] | 
committer: Michael Niedermayer

avcodec/pictordec: Check plane value before doing value/mask computations

Fixes integer overflow
Fixes: 675/clusterfuzz-testcase-6722971232108544

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=63e400a8807dca7b0ffa3841df2e31f7419abb8d
---

 libavcodec/pictordec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/pictordec.c b/libavcodec/pictordec.c
index a3d72e3..a09ee37 100644
--- a/libavcodec/pictordec.c
+++ b/libavcodec/pictordec.c
@@ -77,10 +77,10 @@ static void picmemset(PicContext *s, AVFrame *frame, int 
value, int run,
 if (*y < 0) {
*y = s->height - 1;
*plane += 1;
-   value <<= bits_per_plane;
-   mask  <<= bits_per_plane;
if (*plane >= s->nb_planes)
return;
+   value <<= bits_per_plane;
+   mask  <<= bits_per_plane;
 }
 }
 }

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avcodec/vp56: Factorize vp56_render_mb() out

2017-02-27 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sat 
Feb 25 21:07:22 2017 +0100| [4c0139463c8f0a6f28e7b193c2a85608a7635bbd] | 
committer: Michael Niedermayer

avcodec/vp56: Factorize vp56_render_mb() out

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4c0139463c8f0a6f28e7b193c2a85608a7635bbd
---

 libavcodec/vp56.c | 77 +--
 1 file changed, 23 insertions(+), 54 deletions(-)

diff --git a/libavcodec/vp56.c b/libavcodec/vp56.c
index b36c99f..a9a1a0c 100644
--- a/libavcodec/vp56.c
+++ b/libavcodec/vp56.c
@@ -400,30 +400,18 @@ static void vp56_mc(VP56Context *s, int b, int plane, 
uint8_t *src,
 }
 }
 
-static int vp56_decode_mb(VP56Context *s, int row, int col, int is_alpha)
+static av_always_inline void vp56_render_mb(VP56Context *s, int row, int col, 
int is_alpha, VP56mb mb_type)
 {
-AVFrame *frame_current, *frame_ref;
-VP56mb mb_type;
-VP56Frame ref_frame;
 int b, ab, b_max, plane, off;
-int ret;
-
-if (s->frames[VP56_FRAME_CURRENT]->key_frame)
-mb_type = VP56_MB_INTRA;
-else
-mb_type = vp56_decode_mv(s, row, col);
-ref_frame = ff_vp56_reference_frame[mb_type];
-
-ret = s->parse_coeff(s);
-if (ret < 0)
-return ret;
+AVFrame *frame_current, *frame_ref;
+VP56Frame ref_frame = ff_vp56_reference_frame[mb_type];
 
 vp56_add_predictors_dc(s, ref_frame);
 
 frame_current = s->frames[VP56_FRAME_CURRENT];
 frame_ref = s->frames[ref_frame];
 if (mb_type != VP56_MB_INTRA && !frame_ref->data[0])
-return 0;
+return;
 
 ab = 6*is_alpha;
 b_max = 6 - 2*is_alpha;
@@ -473,57 +461,38 @@ static int vp56_decode_mb(VP56Context *s, int row, int 
col, int is_alpha)
 s->block_coeff[4][0] = 0;
 s->block_coeff[5][0] = 0;
 }
-return 0;
 }
 
-static int vp56_conceal_mb(VP56Context *s, int row, int col, int is_alpha)
+static int vp56_decode_mb(VP56Context *s, int row, int col, int is_alpha)
 {
-AVFrame *frame_current, *frame_ref;
 VP56mb mb_type;
-VP56Frame ref_frame;
-int b, ab, b_max, plane, off;
+int ret;
 
 if (s->frames[VP56_FRAME_CURRENT]->key_frame)
 mb_type = VP56_MB_INTRA;
 else
-mb_type = vp56_conceal_mv(s, row, col);
-ref_frame = ff_vp56_reference_frame[mb_type];
+mb_type = vp56_decode_mv(s, row, col);
 
-frame_current = s->frames[VP56_FRAME_CURRENT];
-frame_ref = s->frames[ref_frame];
-if (mb_type != VP56_MB_INTRA && !frame_ref->data[0])
-return 0;
+ret = s->parse_coeff(s);
+if (ret < 0)
+return ret;
 
-ab = 6*is_alpha;
-b_max = 6 - 2*is_alpha;
+vp56_render_mb(s, row, col, is_alpha, mb_type);
 
-switch (mb_type) {
-case VP56_MB_INTRA:
-for (b=0; bvp3dsp.idct_put(frame_current->data[plane] + 
s->block_offset[b],
-s->stride[plane], s->block_coeff[b]);
-}
-break;
+return 0;
+}
 
-case VP56_MB_INTER_NOVEC_PF:
-case VP56_MB_INTER_NOVEC_GF:
-for (b=0; bblock_offset[b];
-s->hdsp.put_pixels_tab[1][0](frame_current->data[plane] + off,
- frame_ref->data[plane] + off,
- s->stride[plane], 8);
-s->vp3dsp.idct_add(frame_current->data[plane] + off,
-s->stride[plane], s->block_coeff[b]);
-}
-break;
-}
+static int vp56_conceal_mb(VP56Context *s, int row, int col, int is_alpha)
+{
+VP56mb mb_type;
+
+if (s->frames[VP56_FRAME_CURRENT]->key_frame)
+mb_type = VP56_MB_INTRA;
+else
+mb_type = vp56_conceal_mv(s, row, col);
+
+vp56_render_mb(s, row, col, is_alpha, mb_type);
 
-if (is_alpha) {
-s->block_coeff[4][0] = 0;
-s->block_coeff[5][0] = 0;
-}
 return 0;
 }
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] MAINTAINERS: Make formating of ffmpeg-security entry the same as others

2017-02-27 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Thu 
Feb 23 17:34:40 2017 +0100| [3d66eb6ec3336c28d2ad074f2f09fbbe53eb288a] | 
committer: Michael Niedermayer

MAINTAINERS: Make formating of ffmpeg-security entry the same as others

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3d66eb6ec3336c28d2ad074f2f09fbbe53eb288a
---

 MAINTAINERS | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 9c12fec..db55346 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -60,11 +60,7 @@ mailing lists   Baptiste Coudurier, 
Lou Logan
 Google+ Paul B Mahol, Michael Niedermayer, 
Alexander Strasser
 Twitter Lou Logan, Reynaldo H. Verdejo Pinochet
 Launchpad   Timothy Gu
-ffmpeg-security Andreas Cadhalpun
-Carl Eugen Hoyos
-Clément Bœsch
-Michael Niedermayer
-Reimar Doeffinger
+ffmpeg-security Andreas Cadhalpun, Carl Eugen Hoyos, 
Clément Bœsch, Michael Niedermayer, Reimar Doeffinger
 
 
 libavutil

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] MAINTAINERS: Add Rodger Combs to ffmpeg-security

2017-02-27 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Thu 
Feb 23 17:34:42 2017 +0100| [7f62368bacdbf6fdc769876f5e4ad5a18afb46ef] | 
committer: Michael Niedermayer

MAINTAINERS: Add Rodger Combs to ffmpeg-security

Rodger Combs will be added to the ffmpeg-security alias when this patch is 
applied

Reviewed-by: Paul B Mahol 
Reviewed-by: Clément Bœsch 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7f62368bacdbf6fdc769876f5e4ad5a18afb46ef
---

 MAINTAINERS | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index e39cf88..6b17b13 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -60,7 +60,7 @@ mailing lists   Baptiste Coudurier, 
Lou Logan
 Google+ Paul B Mahol, Michael Niedermayer, 
Alexander Strasser
 Twitter Lou Logan, Reynaldo H. Verdejo Pinochet
 Launchpad   Timothy Gu
-ffmpeg-security Andreas Cadhalpun, Carl Eugen Hoyos, 
Clément Bœsch, Michael Niedermayer, Reimar Doeffinger, wm4
+ffmpeg-security Andreas Cadhalpun, Carl Eugen Hoyos, 
Clément Bœsch, Michael Niedermayer, Reimar Doeffinger, Rodger Combs, wm4
 
 
 libavutil

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] MAINTAINERS: add wm4 to ffmpeg-security

2017-02-27 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Thu 
Feb 23 17:34:41 2017 +0100| [4f218682071c956a29e386237ff1f2545aee54df] | 
committer: Michael Niedermayer

MAINTAINERS: add wm4 to ffmpeg-security

wm4 will be added to the ffmpeg-security alias when this patch is applied

Reviewed-by: Paul B Mahol 
Reviewed-by: Clément Bœsch 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4f218682071c956a29e386237ff1f2545aee54df
---

 MAINTAINERS | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index db55346..e39cf88 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -60,7 +60,7 @@ mailing lists   Baptiste Coudurier, 
Lou Logan
 Google+ Paul B Mahol, Michael Niedermayer, 
Alexander Strasser
 Twitter Lou Logan, Reynaldo H. Verdejo Pinochet
 Launchpad   Timothy Gu
-ffmpeg-security Andreas Cadhalpun, Carl Eugen Hoyos, 
Clément Bœsch, Michael Niedermayer, Reimar Doeffinger
+ffmpeg-security Andreas Cadhalpun, Carl Eugen Hoyos, 
Clément Bœsch, Michael Niedermayer, Reimar Doeffinger, wm4
 
 
 libavutil

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avcodec/h264idct_template: Fix multiple runtime error: signed integer overflow

2017-02-27 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sun 
Feb 26 20:28:01 2017 +0100| [4ea7744859dc3d214ef13e920f5d07b070920e3f] | 
committer: Michael Niedermayer

avcodec/h264idct_template: Fix multiple runtime error: signed integer overflow

Fixes: 677/clusterfuzz-testcase-6635120628858880

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Reviewed-by: Steven Liu 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4ea7744859dc3d214ef13e920f5d07b070920e3f
---

 libavcodec/h264idct_template.c | 26 +-
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/libavcodec/h264idct_template.c b/libavcodec/h264idct_template.c
index c00900b..9c5a43c 100644
--- a/libavcodec/h264idct_template.c
+++ b/libavcodec/h264idct_template.c
@@ -40,10 +40,10 @@ void FUNCC(ff_h264_idct_add)(uint8_t *_dst, int16_t 
*_block, int stride)
 block[0] += 1 << 5;
 
 for(i=0; i<4; i++){
-const int z0=  block[i + 4*0] +  block[i + 4*2];
-const int z1=  block[i + 4*0] -  block[i + 4*2];
-const int z2= (block[i + 4*1]>>1) -  block[i + 4*3];
-const int z3=  block[i + 4*1] + (block[i + 4*3]>>1);
+const SUINT z0=  block[i + 4*0] +  block[i + 4*2];
+const SUINT z1=  block[i + 4*0] -  block[i + 4*2];
+const SUINT z2= (block[i + 4*1]>>1) -  block[i + 4*3];
+const SUINT z3=  block[i + 4*1] + (block[i + 4*3]>>1);
 
 block[i + 4*0]= z0 + z3;
 block[i + 4*1]= z1 + z2;
@@ -52,15 +52,15 @@ void FUNCC(ff_h264_idct_add)(uint8_t *_dst, int16_t 
*_block, int stride)
 }
 
 for(i=0; i<4; i++){
-const int z0=  block[0 + 4*i] +  block[2 + 4*i];
-const int z1=  block[0 + 4*i] -  block[2 + 4*i];
-const int z2= (block[1 + 4*i]>>1) -  block[3 + 4*i];
-const int z3=  block[1 + 4*i] + (block[3 + 4*i]>>1);
-
-dst[i + 0*stride]= av_clip_pixel(dst[i + 0*stride] + ((z0 + z3) >> 6));
-dst[i + 1*stride]= av_clip_pixel(dst[i + 1*stride] + ((z1 + z2) >> 6));
-dst[i + 2*stride]= av_clip_pixel(dst[i + 2*stride] + ((z1 - z2) >> 6));
-dst[i + 3*stride]= av_clip_pixel(dst[i + 3*stride] + ((z0 - z3) >> 6));
+const SUINT z0=  block[0 + 4*i] +  (SUINT)block[2 + 4*i];
+const SUINT z1=  block[0 + 4*i] -  (SUINT)block[2 + 4*i];
+const SUINT z2= (block[1 + 4*i]>>1) -  (SUINT)block[3 + 4*i];
+const SUINT z3=  block[1 + 4*i] + (SUINT)(block[3 + 4*i]>>1);
+
+dst[i + 0*stride]= av_clip_pixel(dst[i + 0*stride] + ((int)(z0 + z3) 
>> 6));
+dst[i + 1*stride]= av_clip_pixel(dst[i + 1*stride] + ((int)(z1 + z2) 
>> 6));
+dst[i + 2*stride]= av_clip_pixel(dst[i + 2*stride] + ((int)(z1 - z2) 
>> 6));
+dst[i + 3*stride]= av_clip_pixel(dst[i + 3*stride] + ((int)(z0 - z3) 
>> 6));
 }
 
 memset(block, 0, 16 * sizeof(dctcoef));

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog