[FFmpeg-cvslog] tests/api/api-seek-test: check all compute_crc_of_packets() calls

2016-12-06 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Tue 
Dec  6 14:07:42 2016 +0100| [7679c38b3b57125007aa67b009665c8d3e8d6bcc] | 
committer: Michael Niedermayer

tests/api/api-seek-test: check all compute_crc_of_packets() calls

Signed-off-by: Michael Niedermayer 

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

 tests/api/api-seek-test.c | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/tests/api/api-seek-test.c b/tests/api/api-seek-test.c
index 799187f..cc3287b 100644
--- a/tests/api/api-seek-test.c
+++ b/tests/api/api-seek-test.c
@@ -248,10 +248,11 @@ static int seek_test(const char *input_filename, const 
char *start, const char *
 return -1;
 
 for (i = start_ts; i < end_ts; i += 100) {
-for (j = i + 100; j < end_ts; j += 100)
-result = compute_crc_of_packets(fmt_ctx, video_stream, ctx, fr, i, j, 
0);
-if (result != 0)
-return -1;
+for (j = i + 100; j < end_ts; j += 100) {
+result = compute_crc_of_packets(fmt_ctx, video_stream, ctx, fr, i, 
j, 0);
+if (result != 0)
+return -1;
+}
 }
 
 av_freep(&crc_array);

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


[FFmpeg-cvslog] tests/api/api-seek-test: Fix use of uinitialized value

2016-12-06 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Tue 
Dec  6 14:08:39 2016 +0100| [108db37586e4e5bb5ba0ea3b927d72bc4f25939b] | 
committer: Michael Niedermayer

tests/api/api-seek-test: Fix use of uinitialized value

Signed-off-by: Michael Niedermayer 

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

 tests/api/api-seek-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/api/api-seek-test.c b/tests/api/api-seek-test.c
index 8117df4..9544dfb 100644
--- a/tests/api/api-seek-test.c
+++ b/tests/api/api-seek-test.c
@@ -129,7 +129,7 @@ static int compute_crc_of_packets(AVFormatContext *fmt_ctx, 
int video_stream,
 av_log(NULL, AV_LOG_ERROR, "Can't copy image to buffer\n");
 return number_of_written_bytes;
 }
-if ((fr->pts > ts_end) && (!no_seeking))
+if ((!no_seeking) && (fr->pts > ts_end))
 break;
 crc = av_adler32_update(0, (const uint8_t*)byte_buffer, 
number_of_written_bytes);
 printf("%10"PRId64", 0x%08lx\n", fr->pts, crc);

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


[FFmpeg-cvslog] tests/api/api-seek-test: Silence compiler warnings about uninitialized variables

2016-12-06 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Tue 
Dec  6 14:16:02 2016 +0100| [5952b8da0b7f65dfa23991e71737e0abdaeb339c] | 
committer: Michael Niedermayer

tests/api/api-seek-test: Silence compiler warnings about uninitialized variables

Signed-off-by: Michael Niedermayer 

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

 tests/api/api-seek-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/api/api-seek-test.c b/tests/api/api-seek-test.c
index 9544dfb..799187f 100644
--- a/tests/api/api-seek-test.c
+++ b/tests/api/api-seek-test.c
@@ -243,7 +243,7 @@ static int seek_test(const char *input_filename, const char 
*start, const char *
 return AVERROR(ENOMEM);
 }
 
-result = compute_crc_of_packets(fmt_ctx, video_stream, ctx, fr, i, j, 1);
+result = compute_crc_of_packets(fmt_ctx, video_stream, ctx, fr, 0, 0, 1);
 if (result != 0)
 return -1;
 

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


[FFmpeg-cvslog] Added test for libavcodec/avpacket.c

2016-12-06 Thread Thomas Turner
ffmpeg | branch: master | Thomas Turner  | Mon Dec  5 
22:22:41 2016 -0800| [da3c69a5a97d0f8ce6522b9c15f7a2c5027cf572] | committer: 
Michael Niedermayer

Added test for libavcodec/avpacket.c

Signed-off-by: Thomas Turner 
Signed-off-by: Michael Niedermayer 

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

 libavcodec/Makefile |   3 +-
 libavcodec/tests/avpacket.c | 128 
 tests/fate/libavcodec.mak   |   5 ++
 3 files changed, 135 insertions(+), 1 deletion(-)

diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 82f7fa2..6dd294e 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -1003,7 +1003,8 @@ SKIPHEADERS-$(CONFIG_VDA)  += vda.h 
vda_vt_internal.h
 SKIPHEADERS-$(CONFIG_VDPAU)+= vdpau.h vdpau_internal.h
 SKIPHEADERS-$(CONFIG_VIDEOTOOLBOX) += videotoolbox.h vda_vt_internal.h
 
-TESTPROGS = imgconvert  \
+TESTPROGS = avpacket\
+imgconvert  \
 jpeg2000dwt \
 mathops\
 options \
diff --git a/libavcodec/tests/avpacket.c b/libavcodec/tests/avpacket.c
new file mode 100644
index 000..90b7234
--- /dev/null
+++ b/libavcodec/tests/avpacket.c
@@ -0,0 +1,128 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include "libavcodec/avcodec.h"
+#include "libavutil/error.h"
+
+
+
+static int setup_side_data_entry(AVPacket* avpkt)
+{
+const uint8_t *data_name = NULL;
+int ret = 0, bytes;
+uint8_t *extra_data = NULL;
+
+
+/* get side_data_name string */
+data_name = av_packet_side_data_name(AV_PKT_DATA_NEW_EXTRADATA);
+
+/* Allocate a memory bloc */
+bytes = strlen(data_name);
+
+if(!(extra_data = av_malloc(bytes))){
+ret = AVERROR(ENOMEM);
+fprintf(stderr, "Error occurred: %s\n", av_err2str(ret));
+exit(1);
+}
+/* copy side_data_name to extra_data array */
+memcpy(extra_data, data_name, bytes);
+
+/* create side data for AVPacket */
+ret = av_packet_add_side_data(avpkt, AV_PKT_DATA_NEW_EXTRADATA,
+extra_data, bytes);
+if(ret < 0){
+fprintf(stderr,
+"Error occurred in av_packet_add_side_data: %s\n",
+av_err2str(ret));
+}
+
+return ret;
+}
+
+static int initializations(AVPacket* avpkt)
+{
+const static uint8_t* data = "selftest for av_packet_clone(...)";
+int ret = 0;
+
+/* initialize avpkt */
+av_init_packet(avpkt);
+
+/* set values for avpkt */
+avpkt->pts = 17;
+avpkt->dts = 2;
+avpkt->data = (uint8_t*)data;
+avpkt->size = strlen(data);
+avpkt->flags = AV_PKT_FLAG_DISCARD;
+avpkt->duration = 100;
+avpkt->pos = 3;
+
+ret = setup_side_data_entry(avpkt);
+
+return ret;
+}
+
+int main(void)
+{
+AVPacket avpkt;
+AVPacket *avpkt_clone = NULL;
+int ret = 0;
+
+if(initializations(&avpkt) < 0){
+printf("failed to initialize variables\n");
+return 1;
+}
+/* test av_packet_clone*/
+avpkt_clone = av_packet_clone(&avpkt);
+
+if(!avpkt_clone) {
+av_log(NULL, AV_LOG_ERROR,"av_packet_clone failed to clone 
AVPacket\n");
+return 1;
+}
+/*test av_grow_packet*/
+if(av_grow_packet(avpkt_clone, 20) < 0){
+av_log(NULL, AV_LOG_ERROR, "av_grow_packet failed\n");
+return 1;
+}
+if(av_grow_packet(avpkt_clone, INT_MAX) == 0){
+printf( "av_grow_packet failed to return error "
+"when \"grow_by\" parameter is too large.\n" );
+ret = 1;
+}
+/* test size error check in av_new_packet*/
+if(av_new_packet(avpkt_clone, INT_MAX) == 0){
+printf( "av_new_packet failed to return error "
+"when \"size\" parameter is too large.\n" );
+ret = 1;
+}
+/*test size error check in av_packet_from_data*/
+

[FFmpeg-cvslog] lavf/chromaprint: Update for version 1.4

2016-12-06 Thread Georgi D. Sotirov
ffmpeg | branch: master | Georgi D. Sotirov  | Tue Dec  6 
21:07:59 2016 +0100| [581f93f37ef2e7a00662828ed0348d1edb9041fe] | committer: 
Carl Eugen Hoyos

lavf/chromaprint: Update for version 1.4

Fixes ticket #5997.

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

 libavformat/chromaprint.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/libavformat/chromaprint.c b/libavformat/chromaprint.c
index 8c9a6c0..4da02be 100644
--- a/libavformat/chromaprint.c
+++ b/libavformat/chromaprint.c
@@ -39,7 +39,11 @@ typedef struct ChromaprintMuxContext {
 int silence_threshold;
 int algorithm;
 FingerprintFormat fp_format;
+#if CPR_VERSION_INT >= AV_VERSION_INT(1, 4, 0)
+ChromaprintContext *ctx;
+#else
 ChromaprintContext ctx;
+#endif
 } ChromaprintMuxContext;
 
 static void cleanup(ChromaprintMuxContext *cpr)

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


[FFmpeg-cvslog] omx: Fix OOM check

2016-12-06 Thread Timothy Gu
ffmpeg | branch: master | Timothy Gu  | Mon Dec  5 
09:24:47 2016 -0800| [16a75304fe42d3a007c78126b6370c94ccf891f6] | committer: 
Timothy Gu

omx: Fix OOM check

Also use av_mallocz_array().

Fixes CID1396839.

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

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

diff --git a/libavcodec/omx.c b/libavcodec/omx.c
index c1b6fb9..b5093f4 100644
--- a/libavcodec/omx.c
+++ b/libavcodec/omx.c
@@ -352,12 +352,12 @@ static av_cold int find_component(OMXContext 
*omx_context, void *logctx,
 av_log(logctx, AV_LOG_WARNING, "No component for role %s found\n", 
role);
 return AVERROR_ENCODER_NOT_FOUND;
 }
-components = av_mallocz(sizeof(char*) * num);
+components = av_mallocz_array(num, sizeof(*components));
 if (!components)
 return AVERROR(ENOMEM);
 for (i = 0; i < num; i++) {
 components[i] = av_mallocz(OMX_MAX_STRINGNAME_SIZE);
-if (!components) {
+if (!components[i]) {
 ret = AVERROR(ENOMEM);
 goto end;
 }

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


[FFmpeg-cvslog] qsvdec: Fix memory leak

2016-12-06 Thread Timothy Gu
ffmpeg | branch: master | Timothy Gu  | Mon Dec  5 
10:20:26 2016 -0800| [b6f80b16d1a82463a77352b8756e1cdcaa3a33d0] | committer: 
Timothy Gu

qsvdec: Fix memory leak

Fixes CID1396851.

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

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

diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c
index ea4abfa..258042d 100644
--- a/libavcodec/qsvdec.c
+++ b/libavcodec/qsvdec.c
@@ -305,8 +305,10 @@ static int qsv_decode(AVCodecContext *avctx, QSVContext *q,
 
 do {
 ret = get_surface(avctx, q, &insurf);
-if (ret < 0)
+if (ret < 0) {
+av_freep(&sync);
 return ret;
+}
 
 ret = MFXVideoDECODE_DecodeFrameAsync(q->session, avpkt->size ? &bs : 
NULL,
   insurf, &outsurf, sync);

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


[FFmpeg-cvslog] whitespace changes after last commit

2016-12-06 Thread James Darnley
ffmpeg | branch: master | James Darnley  | Thu Dec  1 02:47:24 
2016 +0100| [58ca2ef62e7c3e0b9f17d7ed3e435f996aa061fe] | committer: James 
Darnley

whitespace changes after last commit

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

 libavcodec/x86/h264dsp_init.c | 44 +--
 1 file changed, 22 insertions(+), 22 deletions(-)

diff --git a/libavcodec/x86/h264dsp_init.c b/libavcodec/x86/h264dsp_init.c
index 7cc0655..7e16dca 100644
--- a/libavcodec/x86/h264dsp_init.c
+++ b/libavcodec/x86/h264dsp_init.c
@@ -108,34 +108,34 @@ void ff_deblock_ ## DIR ## _ ## TYPE ## _ ## DEPTH ## _ 
## OPT(uint8_t *pix,  \
int beta);
 
 #define LF_FUNCS(type, depth)   \
-LF_FUNC(h,  chroma,   depth, mmxext)\
-LF_IFUNC(h, chroma_intra, depth, mmxext)\
+LF_FUNC(h,  chroma,  depth, mmxext) \
+LF_IFUNC(h, chroma_intra,depth, mmxext) \
 LF_FUNC(h,  chroma422,   depth, mmxext) \
 LF_IFUNC(h, chroma422_intra, depth, mmxext) \
-LF_FUNC(v,  chroma,   depth, mmxext)\
-LF_IFUNC(v, chroma_intra, depth, mmxext)\
-LF_FUNC(h,  luma, depth, mmxext)\
-LF_IFUNC(h, luma_intra,   depth, mmxext)\
-LF_FUNC(h,  luma, depth, sse2)  \
-LF_IFUNC(h, luma_intra,   depth, sse2)  \
-LF_FUNC(v,  luma, depth, sse2)  \
-LF_IFUNC(v, luma_intra,   depth, sse2)  \
-LF_FUNC(h,  chroma,   depth, sse2)  \
-LF_IFUNC(h, chroma_intra, depth, sse2)  \
+LF_FUNC(v,  chroma,  depth, mmxext) \
+LF_IFUNC(v, chroma_intra,depth, mmxext) \
+LF_FUNC(h,  luma,depth, mmxext) \
+LF_IFUNC(h, luma_intra,  depth, mmxext) \
+LF_FUNC(h,  luma,depth, sse2)   \
+LF_IFUNC(h, luma_intra,  depth, sse2)   \
+LF_FUNC(v,  luma,depth, sse2)   \
+LF_IFUNC(v, luma_intra,  depth, sse2)   \
+LF_FUNC(h,  chroma,  depth, sse2)   \
+LF_IFUNC(h, chroma_intra,depth, sse2)   \
 LF_FUNC(h,  chroma422,   depth, sse2)   \
 LF_IFUNC(h, chroma422_intra, depth, sse2)   \
-LF_FUNC(v,  chroma,   depth, sse2)  \
-LF_IFUNC(v, chroma_intra, depth, sse2)  \
-LF_FUNC(h,  luma, depth, avx)   \
-LF_IFUNC(h, luma_intra,   depth, avx)   \
-LF_FUNC(v,  luma, depth, avx)   \
-LF_IFUNC(v, luma_intra,   depth, avx)   \
-LF_FUNC(h,  chroma,   depth, avx)   \
-LF_IFUNC(h, chroma_intra, depth, avx)   \
+LF_FUNC(v,  chroma,  depth, sse2)   \
+LF_IFUNC(v, chroma_intra,depth, sse2)   \
+LF_FUNC(h,  luma,depth, avx)\
+LF_IFUNC(h, luma_intra,  depth, avx)\
+LF_FUNC(v,  luma,depth, avx)\
+LF_IFUNC(v, luma_intra,  depth, avx)\
+LF_FUNC(h,  chroma,  depth, avx)\
+LF_IFUNC(h, chroma_intra,depth, avx)\
 LF_FUNC(h,  chroma422,   depth, avx)\
 LF_IFUNC(h, chroma422_intra, depth, avx)\
-LF_FUNC(v,  chroma,   depth, avx)   \
-LF_IFUNC(v, chroma_intra, depth, avx)
+LF_FUNC(v,  chroma,  depth, avx)\
+LF_IFUNC(v, chroma_intra,depth, avx)
 
 LF_FUNCS(uint8_t,   8)
 LF_FUNCS(uint16_t, 10)

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


[FFmpeg-cvslog] avcodec/h264: mmx2, sse2, avx 10-bit h chroma deblock/loop filter

2016-12-06 Thread James Darnley
ffmpeg | branch: master | James Darnley  | Wed Nov 30 21:17:16 
2016 +0100| [add21d0bb3f5fb25fd5d1437eb746b91c2570a8f] | committer: James 
Darnley

avcodec/h264: mmx2, sse2, avx 10-bit h chroma deblock/loop filter

Yorkfield:
 - mmx2: 2.45x (279 vs. 114 cycles)
 - sse2: 3.36x (279 vs.  83 cycles)

Nehalem:
 - mmx2: 2.10x (192 vs.  92 cycles)
 - sse2: 2.84x (192 vs.  68 cycles)

Skylake:
 - mmx2: 1.75x (170 vs.  97 cycles)
 - sse2: 2.47x (170 vs.  69 cycles)
 - avx:  2.47x (170 vs.  69 cycles)

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

 libavcodec/x86/h264_deblock_10bit.asm | 118 ++
 libavcodec/x86/h264dsp_init.c |   9 +++
 2 files changed, 127 insertions(+)

diff --git a/libavcodec/x86/h264_deblock_10bit.asm 
b/libavcodec/x86/h264_deblock_10bit.asm
index ebf8a3f..3536e41 100644
--- a/libavcodec/x86/h264_deblock_10bit.asm
+++ b/libavcodec/x86/h264_deblock_10bit.asm
@@ -843,6 +843,88 @@ DEBLOCK_LUMA_INTRA
 mova [r0+2*r1], m2
 %endmacro
 
+; expands to [base],...,[base+7*stride]
+%define PASS8ROWS(base, base3, stride, stride3) \
+[base], [base+stride], [base+stride*2], [base3], \
+[base3+stride], [base3+stride*2], [base3+stride3], [base3+stride*4]
+
+; in: 8 rows of 4 words in %4..%11
+; out: 4 rows of 8 words in m0..m3
+%macro TRANSPOSE4x8W_LOAD 8
+movq m0, %1
+movq m2, %2
+movq m1, %3
+movq m3, %4
+
+punpcklwdm0, m2
+punpcklwdm1, m3
+punpckhdqm2, m0, m1
+punpckldqm0, m1
+
+movq m4, %5
+movq m6, %6
+movq m5, %7
+movq m3, %8
+
+punpcklwdm4, m6
+punpcklwdm5, m3
+punpckhdqm6, m4, m5
+punpckldqm4, m5
+
+punpckhqdq   m1, m0, m4
+punpcklqdq   m0, m4
+punpckhqdq   m3, m2, m6
+punpcklqdq   m2, m6
+%endmacro
+
+; in: 4 rows of 8 words in m0..m3
+; out: 8 rows of 4 words in %1..%8
+%macro TRANSPOSE8x4W_STORE 8
+TRANSPOSE4x4W 0, 1, 2, 3, 4
+movq %1, m0
+movhps   %2, m0
+movq %3, m1
+movhps   %4, m1
+movq %5, m2
+movhps   %6, m2
+movq %7, m3
+movhps   %8, m3
+%endmacro
+
+; %1 = base + 3*stride
+; %2 = 3*stride (unused on mmx)
+; %3, %4 = place to store p1 and q1 values
+%macro CHROMA_H_LOAD 4
+%if mmsize == 8
+movq m0, [pix_q - 4]
+movq m1, [pix_q +   stride_q - 4]
+movq m2, [pix_q + 2*stride_q - 4]
+movq m3, [%1 - 4]
+TRANSPOSE4x4W 0, 1, 2, 3, 4
+%else
+TRANSPOSE4x8W_LOAD PASS8ROWS(pix_q-4, %1-4, stride_q, %2)
+%endif
+mova %3, m0
+mova %4, m3
+%endmacro
+
+; %1 = base + 3*stride
+; %2 = 3*stride (unused on mmx)
+; %3, %4 = place to load p1 and q1 values
+%macro CHROMA_H_STORE 4
+mova m0, %3
+mova m3, %4
+%if mmsize == 8
+TRANSPOSE4x4W 0, 1, 2, 3, 4
+movq [pix_q - 4],  m0
+movq [pix_q +   stride_q - 4], m1
+movq [pix_q + 2*stride_q - 4], m2
+movq [%1 - 4], m3
+%else
+TRANSPOSE8x4W_STORE PASS8ROWS(pix_q-4, %1-4, stride_q, %2)
+%endif
+%endmacro
+
 %macro CHROMA_V_LOAD_TC 2
 movd%1, [%2]
 punpcklbw   %1, %1
@@ -914,6 +996,42 @@ cglobal deblock_v_chroma_intra_10, 
4,6-(mmsize/16),8*(mmsize/16)
 %else
 RET
 %endif
+
+;-
+; void ff_deblock_h_chroma_10(uint16_t *pix, int stride, int alpha, int beta,
+; int8_t *tc0)
+;-
+cglobal deblock_h_chroma_10, 5, 7, 8, 2*mmsize, pix_, stride_, alpha_, beta_, 
tc0_
+shl alpha_d,  2
+shl beta_d,   2
+mov r5,   pix_q
+lea r6,  [3*stride_q]
+add r5,   r6
+%if mmsize == 8
+mov r6d,  2
+.loop:
+%endif
+
+CHROMA_H_LOAD r5, r6, [rsp], [rsp + mmsize]
+LOAD_AB  m4,  m5, alpha_d, beta_d
+LOAD_MASKm0,  m1, m2, m3, m4, m5, m7, m6, m4
+pxor m4,  m4
+CHROMA_V_LOAD_TC m6,  tc0_q
+psubwm6, [pw_3]
+pmaxsw   m6,  m4
+pand m7,  m6
+DEBLOCK_P0_Q0m1,  m2, m0, m3, m7, m5, m6
+CHROMA_H_STORE r5, r6, [rsp], [rsp + mmsize]
+
+%if mmsize == 8
+lea pix_q, [pix_q + 4*stride_q]
+lea r5,[r5 + 4*stride_q]
+add tc0_q,  2
+dec r6d
+jg .loop
+%endif
+RET
+
 %endmacro
 
 %if ARCH_X86_64 == 0
diff --git a/libavcodec/x86/h264dsp_init.c b/libavcodec/x86/h264dsp_init.c
index 7e16dca..ab270da 100644
--- a/libavcodec/x86/h264dsp_init.c
+++ b/libavcodec/x86/h264dsp_init.c
@@ -313,6 +313,9 @@ av_cold void ff_h264dsp_init_x86(H264DSPContext *c, const 
int bit_depth,

[FFmpeg-cvslog] avcodec/h264: mmx2, sse2, avx 10-bit 4:2:2 h chroma deblock/loop filter

2016-12-06 Thread James Darnley
ffmpeg | branch: master | James Darnley  | Thu Dec  1 03:15:10 
2016 +0100| [728651df06f48b49228ac5b8241b1ebe8d5b9d73] | committer: James 
Darnley

avcodec/h264: mmx2, sse2, avx 10-bit 4:2:2 h chroma deblock/loop filter

Yorkfield:
 - mmx2: 2.53x (504 vs. 199 cycles)
 - sse2: 3.83x (504 vs. 131 cycles)

Nehalem:
 - mmx2: 2.42x (365 vs. 151 cycles)
 - sse2: 3.56x (365 vs. 103 cycles)

Skylake:
 - mmx2: 1.81x (308 vs. 170 cycles)
 - sse2: 2.84x (308 vs. 108 cycles)
 - avx:  2.93x (308 vs. 105 cycles)

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

 libavcodec/x86/h264_deblock_10bit.asm | 39 +++
 libavcodec/x86/h264dsp_init.c |  6 ++
 2 files changed, 45 insertions(+)

diff --git a/libavcodec/x86/h264_deblock_10bit.asm 
b/libavcodec/x86/h264_deblock_10bit.asm
index 3536e41..56cf4d6 100644
--- a/libavcodec/x86/h264_deblock_10bit.asm
+++ b/libavcodec/x86/h264_deblock_10bit.asm
@@ -1032,6 +1032,45 @@ cglobal deblock_h_chroma_10, 5, 7, 8, 2*mmsize, pix_, 
stride_, alpha_, beta_, tc
 %endif
 RET
 
+;-
+; void ff_deblock_h_chroma422_10(uint16_t *pix, int stride, int alpha, int 
beta,
+;int8_t *tc0)
+;-
+cglobal deblock_h_chroma422_10, 5, 7, 8, 3*mmsize, pix_, stride_, alpha_, 
beta_, tc0_
+shl alpha_d,  2
+shl beta_d,   2
+
+movd m0, [tc0_q]
+punpcklbw m0, m0
+psraw m0, 6
+movq [rsp], m0
+
+mov r5,   pix_q
+lea r6,  [3*stride_q]
+add r5,   r6
+
+mov r4, -8
+.loop:
+
+CHROMA_H_LOAD r5, r6, [rsp + 1*mmsize], [rsp + 2*mmsize]
+LOAD_AB  m4,  m5, alpha_d, beta_d
+LOAD_MASKm0,  m1, m2, m3, m4, m5, m7, m6, m4
+pxor m4,  m4
+movd m6, [rsp + r4 + 8]
+punpcklwdm6,  m6
+punpcklwdm6,  m6
+psubwm6, [pw_3]
+pmaxsw   m6,  m4
+pand m7,  m6
+DEBLOCK_P0_Q0m1,  m2, m0, m3, m7, m5, m6
+CHROMA_H_STORE r5, r6, [rsp + 1*mmsize], [rsp + 2*mmsize]
+
+lea pix_q, [pix_q + (mmsize/2)*stride_q]
+lea r5,[r5 +(mmsize/2)*stride_q]
+add r4, (mmsize/4)
+jl .loop
+RET
+
 %endmacro
 
 %if ARCH_X86_64 == 0
diff --git a/libavcodec/x86/h264dsp_init.c b/libavcodec/x86/h264dsp_init.c
index ab270da..7b3d17f 100644
--- a/libavcodec/x86/h264dsp_init.c
+++ b/libavcodec/x86/h264dsp_init.c
@@ -315,6 +315,8 @@ 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_10_mmxext;
 if (chroma_format_idc <= 1) {
 c->h264_h_loop_filter_chroma = ff_deblock_h_chroma_10_mmxext;
+} else {
+c->h264_h_loop_filter_chroma = 
ff_deblock_h_chroma422_10_mmxext;
 }
 c->h264_v_loop_filter_luma = ff_deblock_v_luma_10_mmxext;
 c->h264_h_loop_filter_luma = ff_deblock_h_luma_10_mmxext;
@@ -351,6 +353,8 @@ 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_10_sse2;
 if (chroma_format_idc <= 1) {
 c->h264_h_loop_filter_chroma = ff_deblock_h_chroma_10_sse2;
+} else {
+c->h264_h_loop_filter_chroma = ff_deblock_h_chroma422_10_sse2;
 }
 #if HAVE_ALIGNED_STACK
 c->h264_v_loop_filter_luma   = ff_deblock_v_luma_10_sse2;
@@ -389,6 +393,8 @@ 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_10_avx;
 if (chroma_format_idc <= 1) {
 c->h264_h_loop_filter_chroma = ff_deblock_h_chroma_10_avx;
+} else {
+c->h264_h_loop_filter_chroma = ff_deblock_h_chroma422_10_avx;
 }
 #if HAVE_ALIGNED_STACK
 c->h264_v_loop_filter_luma = ff_deblock_v_luma_10_avx;

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


[FFmpeg-cvslog] avcodec/h264: clean up and expand x86 function definitions

2016-12-06 Thread James Darnley
ffmpeg | branch: master | James Darnley  | Thu Dec  1 02:44:18 
2016 +0100| [f33714a6948f9e707c00c89795222dea5d4ebe3a] | committer: James 
Darnley

avcodec/h264: clean up and expand x86 function definitions

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

 libavcodec/x86/h264dsp_init.c | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/libavcodec/x86/h264dsp_init.c b/libavcodec/x86/h264dsp_init.c
index c6c643a..7cc0655 100644
--- a/libavcodec/x86/h264dsp_init.c
+++ b/libavcodec/x86/h264dsp_init.c
@@ -110,6 +110,8 @@ void ff_deblock_ ## DIR ## _ ## TYPE ## _ ## DEPTH ## _ ## 
OPT(uint8_t *pix,  \
 #define LF_FUNCS(type, depth)   \
 LF_FUNC(h,  chroma,   depth, mmxext)\
 LF_IFUNC(h, chroma_intra, depth, mmxext)\
+LF_FUNC(h,  chroma422,   depth, mmxext) \
+LF_IFUNC(h, chroma422_intra, depth, mmxext) \
 LF_FUNC(v,  chroma,   depth, mmxext)\
 LF_IFUNC(v, chroma_intra, depth, mmxext)\
 LF_FUNC(h,  luma, depth, mmxext)\
@@ -120,6 +122,8 @@ LF_FUNC(v,  luma, depth, sse2)  \
 LF_IFUNC(v, luma_intra,   depth, sse2)  \
 LF_FUNC(h,  chroma,   depth, sse2)  \
 LF_IFUNC(h, chroma_intra, depth, sse2)  \
+LF_FUNC(h,  chroma422,   depth, sse2)   \
+LF_IFUNC(h, chroma422_intra, depth, sse2)   \
 LF_FUNC(v,  chroma,   depth, sse2)  \
 LF_IFUNC(v, chroma_intra, depth, sse2)  \
 LF_FUNC(h,  luma, depth, avx)   \
@@ -128,15 +132,14 @@ LF_FUNC(v,  luma, depth, avx)   \
 LF_IFUNC(v, luma_intra,   depth, avx)   \
 LF_FUNC(h,  chroma,   depth, avx)   \
 LF_IFUNC(h, chroma_intra, depth, avx)   \
+LF_FUNC(h,  chroma422,   depth, avx)\
+LF_IFUNC(h, chroma422_intra, depth, avx)\
 LF_FUNC(v,  chroma,   depth, avx)   \
 LF_IFUNC(v, chroma_intra, depth, avx)
 
 LF_FUNCS(uint8_t,   8)
 LF_FUNCS(uint16_t, 10)
 
-void ff_deblock_h_chroma422_8_mmxext(uint8_t *pix, int stride, int alpha, int 
beta, int8_t *tc0);
-LF_IFUNC(h, chroma422_intra, 8, mmxext)
-
 #if ARCH_X86_32 && HAVE_MMXEXT_EXTERNAL
 LF_FUNC(v8, luma, 8, mmxext)
 static void deblock_v_luma_8_mmxext(uint8_t *pix, int stride, int alpha,

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


[FFmpeg-cvslog] avformat/hlsenc: save the EXT-X-DISCONTINUITY from old list

2016-12-06 Thread Steven Liu
ffmpeg | branch: master | Steven Liu  | Wed Dec  7 
07:43:36 2016 +0800| [6b95da9af91cd912561aa25593d6a41caa071963] | committer: 
Steven Liu

avformat/hlsenc: save the EXT-X-DISCONTINUITY from old list

when use fix ticket 2nd problem.

command line test step:
rm -rf output*;./ffmpeg  -i ~/Movies/objectC/facebook.mp4 -an -c:v copy
-f hls -hls_time 4 -hls_list_size 5 -hls_flags +delete_segments
-hls_flags +append_list -hls_flags +omit_endlist -hls_flags
+discont_start -t 50 output.m3u8
./ffmpeg -i ~/Movies/objectC/facebook.mp4 -an -c:v libx264 -g 4 -f hls
-hls_time 4 -hls_list_size 5 -hls_flags +delete_segments -hls_flags
+append_list -hls_flags +omit_endlist -hls_flags +discont_start -t 5
output.m3u8
./ffmpeg -i ~/Movies/objectC/facebook.mp4 -an -c:v libx264 -g 4 -f hls
-hls_time 4 -hls_list_size 5 -hls_flags +delete_segments -hls_flags
+append_list -hls_flags +omit_endlist -hls_flags +discont_start -t 5
output.m3u8

result:
 #EXTM3U
 #EXT-X-VERSION:3
 #EXT-X-TARGETDURATION:5
 #EXT-X-MEDIA-SEQUENCE:6
 #EXTINF:4.12,
 output6.ts
 #EXT-X-DISCONTINUITY
 #EXTINF:4.00,
 output7.ts
 #EXTINF:0.96,
 output8.ts
 #EXT-X-DISCONTINUITY
 #EXTINF:4.00,
 output9.ts
 #EXTINF:0.96,
 output10.ts

Signed-off-by: Steven Liu 

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

 libavformat/hlsenc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 0e55a31..acf3a30 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -459,6 +459,9 @@ static int parse_playlist(AVFormatContext *s, const char 
*url)
 read_chomp_line(in, line, sizeof(line));
 if (av_strstart(line, "#EXT-X-MEDIA-SEQUENCE:", &ptr)) {
 hls->sequence = atoi(ptr);
+} else if (av_strstart(line, "#EXT-X-DISCONTINUITY", &ptr)) {
+is_segment = 1;
+hls->discontinuity = 1;
 } else if (av_strstart(line, "#EXTINF:", &ptr)) {
 is_segment = 1;
 hls->duration = atof(ptr);

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