[FFmpeg-cvslog] x86/audiodsp: remove an unnecessary movss

2017-03-21 Thread James Almer
ffmpeg | branch: master | James Almer  | Wed Mar 22 00:14:56 
2017 -0300| [aee046a895db972ce6ac49950dafbad99445191a] | committer: James Almer

x86/audiodsp: remove an unnecessary movss

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

 libavcodec/x86/audiodsp.asm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/x86/audiodsp.asm b/libavcodec/x86/audiodsp.asm
index 8ef2a8c..a44e064 100644
--- a/libavcodec/x86/audiodsp.asm
+++ b/libavcodec/x86/audiodsp.asm
@@ -140,7 +140,8 @@ cglobal vector_clipf, 3, 3, 6, dst, src, len, min, max
 VBROADCASTSS m0, minm
 VBROADCASTSS m1, maxm
 %elif WIN64
-VBROADCASTSS m0, m3
+SWAP 0, 3
+VBROADCASTSS m0, m0
 VBROADCASTSS m1, maxm
 %else ; 64bit sysv
 VBROADCASTSS m0, m0

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


[FFmpeg-cvslog] avdevice/decklink: add format_code of display mode to list_format output

2017-03-21 Thread Matthias Hunstock
ffmpeg | branch: master | Matthias Hunstock  | Mon Mar 
20 00:16:36 2017 +0100| [607bffbed2872641b7f63127934f0398041fa55e] | committer: 
Marton Balint

avdevice/decklink: add format_code of display mode to list_format output

Signed-off-by: Matthias Hunstock 
Signed-off-by: Marton Balint 

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

 libavdevice/decklink_common.cpp | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/libavdevice/decklink_common.cpp b/libavdevice/decklink_common.cpp
index 8b499c5..26c0776 100644
--- a/libavdevice/decklink_common.cpp
+++ b/libavdevice/decklink_common.cpp
@@ -33,6 +33,7 @@ extern "C" {
 #include "libavformat/avformat.h"
 #include "libavformat/internal.h"
 #include "libavutil/imgutils.h"
+#include "libavutil/bswap.h"
 }
 
 #include "decklink_common.h"
@@ -276,6 +277,7 @@ int ff_decklink_list_formats(AVFormatContext *avctx, 
decklink_direction_t direct
 struct decklink_ctx *ctx = (struct decklink_ctx *)cctx->ctx;
 IDeckLinkDisplayModeIterator *itermode;
 IDeckLinkDisplayMode *mode;
+uint32_t format_code;
 int i=0;
 HRESULT res;
 
@@ -297,13 +299,14 @@ int ff_decklink_list_formats(AVFormatContext *avctx, 
decklink_direction_t direct
 return AVERROR(EIO);
 }
 
-av_log(avctx, AV_LOG_INFO, "Supported formats for '%s':\n",
+av_log(avctx, AV_LOG_INFO, "Supported formats for 
'%s':\n\tmode\tformat_code\tdescription",
avctx->filename);
 while (itermode->Next() == S_OK) {
 BMDTimeValue tb_num, tb_den;
 mode->GetFrameRate(_num, _den);
-av_log(avctx, AV_LOG_INFO, "\t%d\t%ldx%ld at %d/%d fps",
-++i,mode->GetWidth(), mode->GetHeight(),
+format_code = av_bswap32(mode->GetDisplayMode());
+av_log(avctx, AV_LOG_INFO, "\n\t%d\t%.4s\t\t%ldx%ld at %d/%d fps",
+++i, (char*) _code, mode->GetWidth(), mode->GetHeight(),
 (int) tb_den, (int) tb_num);
 switch (mode->GetFieldDominance()) {
 case bmdLowerFieldFirst:
@@ -311,9 +314,9 @@ int ff_decklink_list_formats(AVFormatContext *avctx, 
decklink_direction_t direct
 case bmdUpperFieldFirst:
 av_log(avctx, AV_LOG_INFO, " (interlaced, upper field first)"); break;
 }
-av_log(avctx, AV_LOG_INFO, "\n");
 mode->Release();
 }
+av_log(avctx, AV_LOG_INFO, "\n");
 
 itermode->Release();
 

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


[FFmpeg-cvslog] avdevice/decklink: new option 'format_code' to set video format by fourCC

2017-03-21 Thread Matthias Hunstock
ffmpeg | branch: master | Matthias Hunstock  | Mon Mar 
20 00:16:37 2017 +0100| [b3a2adaac6526428843a1fa74eb9f896e898a78a] | committer: 
Marton Balint

avdevice/decklink: new option 'format_code' to set video format by fourCC

Signed-off-by: Matthias Hunstock 
Signed-off-by: Marton Balint 

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

 doc/indevs.texi | 14 ++
 libavdevice/decklink_common.cpp | 16 
 libavdevice/decklink_common_c.h |  1 +
 libavdevice/decklink_dec.cpp|  5 +++--
 libavdevice/decklink_dec_c.c|  1 +
 libavdevice/version.h   |  2 +-
 6 files changed, 28 insertions(+), 11 deletions(-)

diff --git a/doc/indevs.texi b/doc/indevs.texi
index 27cc3d5..51c304f 100644
--- a/doc/indevs.texi
+++ b/doc/indevs.texi
@@ -233,6 +233,12 @@ Defaults to @option{false}.
 If set to @option{true}, print a list of supported formats and exit.
 Defaults to @option{false}.
 
+@item format_code 
+This sets the input video format to the format given by the FourCC. To see
+the supported values of your device(s) use @option{list_formats}.
+Note that there is a FourCC @option{'pal '} that can also be used
+as @option{pal} (3 letters).
+
 @item bm_v210
 If set to @samp{1}, video is captured in 10 bit v210 instead
 of uyvy422. Not all Blackmagic devices support this option.
@@ -296,21 +302,21 @@ ffmpeg -f decklink -list_formats 1 -i 'Intensity Pro'
 @end example
 
 @item
-Capture video clip at 1080i50 (format 11):
+Capture video clip at 1080i50:
 @example
-ffmpeg -f decklink -i 'Intensity Pro@@11' -acodec copy -vcodec copy output.avi
+ffmpeg -format_code Hi50 -f decklink -i 'Intensity Pro' -acodec copy -vcodec 
copy output.avi
 @end example
 
 @item
 Capture video clip at 1080i50 10 bit:
 @example
-ffmpeg -bm_v210 1 -f decklink -i 'UltraStudio Mini Recorder@@11' -acodec copy 
-vcodec copy output.avi
+ffmpeg -bm_v210 1 -format_code Hi50 -f decklink -i 'UltraStudio Mini Recorder' 
-acodec copy -vcodec copy output.avi
 @end example
 
 @item
 Capture video clip at 1080i50 with 16 audio channels:
 @example
-ffmpeg -channels 16 -f decklink -i 'UltraStudio Mini Recorder@@11' -acodec 
copy -vcodec copy output.avi
+ffmpeg -channels 16 -format_code Hi50 -f decklink -i 'UltraStudio Mini 
Recorder' -acodec copy -vcodec copy output.avi
 @end example
 
 @end itemize
diff --git a/libavdevice/decklink_common.cpp b/libavdevice/decklink_common.cpp
index 26c0776..f17c263 100644
--- a/libavdevice/decklink_common.cpp
+++ b/libavdevice/decklink_common.cpp
@@ -33,6 +33,7 @@ extern "C" {
 #include "libavformat/avformat.h"
 #include "libavformat/internal.h"
 #include "libavutil/imgutils.h"
+#include "libavutil/intreadwrite.h"
 #include "libavutil/bswap.h"
 }
 
@@ -158,8 +159,8 @@ int ff_decklink_set_format(AVFormatContext *avctx,
 int i = 1;
 HRESULT res;
 
-av_log(avctx, AV_LOG_DEBUG, "Trying to find mode for frame size %dx%d, 
frame timing %d/%d, field order %d, direction %d, mode number %d\n",
-width, height, tb_num, tb_den, field_order, direction, num);
+av_log(avctx, AV_LOG_DEBUG, "Trying to find mode for frame size %dx%d, 
frame timing %d/%d, field order %d, direction %d, mode number %d, format code 
%s\n",
+width, height, tb_num, tb_den, field_order, direction, num, 
(cctx->format_code) ? cctx->format_code : "(unset)");
 
 if (ctx->duplex_mode) {
 DECKLINK_BOOL duplex_supported = false;
@@ -196,12 +197,17 @@ int ff_decklink_set_format(AVFormatContext *avctx,
 return AVERROR(EIO);
 }
 
+char format_buf[] = "";
+if (cctx->format_code)
+memcpy(format_buf, cctx->format_code, FFMIN(strlen(cctx->format_code), 
sizeof(format_buf)));
+BMDDisplayMode target_mode = (BMDDisplayMode)AV_RB32(format_buf);
 AVRational target_tb = av_make_q(tb_num, tb_den);
 ctx->bmd_mode = bmdModeUnknown;
 while ((ctx->bmd_mode == bmdModeUnknown) && itermode->Next() == S_OK) 
{
 BMDTimeValue bmd_tb_num, bmd_tb_den;
 int bmd_width  = mode->GetWidth();
 int bmd_height = mode->GetHeight();
+BMDDisplayMode bmd_mode = mode->GetDisplayMode();
 BMDFieldDominance bmd_field_dominance = mode->GetFieldDominance();
 
 mode->GetFrameRate(_tb_num, _tb_den);
@@ -210,8 +216,10 @@ int ff_decklink_set_format(AVFormatContext *avctx,
 if ((bmd_width == width &&
  bmd_height == height &&
  !av_cmp_q(mode_tb, target_tb) &&
- field_order_eq(field_order, bmd_field_dominance)) || i == num) {
-ctx->bmd_mode   = mode->GetDisplayMode();
+ field_order_eq(field_order, bmd_field_dominance))
+ || i == num
+ || target_mode == bmd_mode) {
+ctx->bmd_mode   = bmd_mode;
 ctx->bmd_width  = bmd_width;
 ctx->bmd_height = bmd_height;
 ctx->bmd_tb_den = 

[FFmpeg-cvslog] hwcontext: fix comments for av_hwdevice_ctx_alloc()

2017-03-21 Thread Jun Zhao
ffmpeg | branch: master | Jun Zhao  | Sun Mar 19 15:44:46 
2017 +0800| [9365dfcbf665b83b2e60c5ec5e2abf1f0a49e2c3] | committer: Mark 
Thompson

hwcontext: fix comments for av_hwdevice_ctx_alloc()

fix the wrong comments for av_hwdevice_ctx_alloc()

Signed-off-by: Jun Zhao 
Signed-off-by: Mark Thompson 

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

 libavutil/hwcontext.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/libavutil/hwcontext.h b/libavutil/hwcontext.h
index 785da09..f5bc077 100644
--- a/libavutil/hwcontext.h
+++ b/libavutil/hwcontext.h
@@ -223,10 +223,9 @@ typedef struct AVHWFramesContext {
 } AVHWFramesContext;
 
 /**
- * Allocate an AVHWDeviceContext for a given pixel format.
+ * Allocate an AVHWDeviceContext for a given hardware type.
  *
- * @param format a hwaccel pixel format (AV_PIX_FMT_FLAG_HWACCEL must be set
- *   on the corresponding format descriptor)
+ * @param type the type of the hardware device to allocate.
  * @return a reference to the newly created AVHWDeviceContext on success or 
NULL
  * on failure.
  */

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


[FFmpeg-cvslog] avcodec/avcodec.h: clarify decoupled decode/encode API docs

2017-03-21 Thread Marton Balint
ffmpeg | branch: master | Marton Balint  | Wed Mar 15 01:00:57 
2017 +0100| [51546504133cbea93284aeda3e30e531fe2c1633] | committer: Marton 
Balint

avcodec/avcodec.h: clarify decoupled decode/encode API docs

Reviewed-by: wm4 
Signed-off-by: Marton Balint 

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

 libavcodec/avcodec.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index f9ebd14..3e3c372 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -142,8 +142,9 @@
  *
  * Not all codecs will follow a rigid and predictable dataflow; the only
  * guarantee is that an AVERROR(EAGAIN) return value on a send/receive call on
- * one end implies that a receive/send call on the other end will succeed. In
- * general, no codec will permit unlimited buffering of input or output.
+ * one end implies that a receive/send call on the other end will succeed, or
+ * at least will not fail with AVERROR(EAGAIN). In general, no codec will
+ * permit unlimited buffering of input or output.
  *
  * This API replaces the following legacy functions:
  * - avcodec_decode_video2() and avcodec_decode_audio4():

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


[FFmpeg-cvslog] avformat/apng: fix setting frame delay when max_fps is set to no limit

2017-03-21 Thread James Almer
ffmpeg | branch: release/3.1 | James Almer  | Mon Mar 20 
22:53:00 2017 -0300| [b014fa21d4a36eb65e61b530bdafbcdc63d79795] | committer: 
James Almer

avformat/apng: fix setting frame delay when max_fps is set to no limit

Reviewed-by: Michael Niedermayer 
Signed-off-by: James Almer 
(cherry picked from commit 874eb012f75bc18bb6d79ad4bc0912afa21751f3)

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

 libavformat/apngdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/apngdec.c b/libavformat/apngdec.c
index bb17896..7a284e3 100644
--- a/libavformat/apngdec.c
+++ b/libavformat/apngdec.c
@@ -269,7 +269,7 @@ static int decode_fctl_chunk(AVFormatContext *s, 
APNGDemuxContext *ctx, AVPacket
 /* default is hundredths of seconds */
 if (!delay_den)
 delay_den = 100;
-if (!delay_num || delay_den / delay_num > ctx->max_fps) {
+if (!delay_num || (ctx->max_fps && delay_den / delay_num > ctx->max_fps)) {
 delay_num = 1;
 delay_den = ctx->default_fps;
 }

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


[FFmpeg-cvslog] avformat/apng: fix setting frame delay when max_fps is set to no limit

2017-03-21 Thread James Almer
ffmpeg | branch: release/3.0 | James Almer  | Mon Mar 20 
22:53:00 2017 -0300| [48706b9fef0c9f4594630dacfe5561c6f96cd193] | committer: 
James Almer

avformat/apng: fix setting frame delay when max_fps is set to no limit

Reviewed-by: Michael Niedermayer 
Signed-off-by: James Almer 
(cherry picked from commit 874eb012f75bc18bb6d79ad4bc0912afa21751f3)

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

 libavformat/apngdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/apngdec.c b/libavformat/apngdec.c
index c6403a1..d9f9ee3 100644
--- a/libavformat/apngdec.c
+++ b/libavformat/apngdec.c
@@ -269,7 +269,7 @@ static int decode_fctl_chunk(AVFormatContext *s, 
APNGDemuxContext *ctx, AVPacket
 /* default is hundredths of seconds */
 if (!delay_den)
 delay_den = 100;
-if (!delay_num || delay_den / delay_num > ctx->max_fps) {
+if (!delay_num || (ctx->max_fps && delay_den / delay_num > ctx->max_fps)) {
 delay_num = 1;
 delay_den = ctx->default_fps;
 }

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


[FFmpeg-cvslog] avformat/apng: fix setting frame delay when max_fps is set to no limit

2017-03-21 Thread James Almer
ffmpeg | branch: release/2.8 | James Almer  | Mon Mar 20 
22:53:00 2017 -0300| [a1ad585c8ef1ec2f00f70ada99af0c67834fd23c] | committer: 
James Almer

avformat/apng: fix setting frame delay when max_fps is set to no limit

Reviewed-by: Michael Niedermayer 
Signed-off-by: James Almer 
(cherry picked from commit 874eb012f75bc18bb6d79ad4bc0912afa21751f3)

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

 libavformat/apngdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/apngdec.c b/libavformat/apngdec.c
index 84298ae..4b506dd 100644
--- a/libavformat/apngdec.c
+++ b/libavformat/apngdec.c
@@ -269,7 +269,7 @@ static int decode_fctl_chunk(AVFormatContext *s, 
APNGDemuxContext *ctx, AVPacket
 /* default is hundredths of seconds */
 if (!delay_den)
 delay_den = 100;
-if (!delay_num || delay_den / delay_num > ctx->max_fps) {
+if (!delay_num || (ctx->max_fps && delay_den / delay_num > ctx->max_fps)) {
 delay_num = 1;
 delay_den = ctx->default_fps;
 }

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


[FFmpeg-cvslog] avformat/apng: fix setting frame delay when max_fps is set to no limit

2017-03-21 Thread James Almer
ffmpeg | branch: release/3.2 | James Almer  | Mon Mar 20 
22:53:00 2017 -0300| [33978a49c02575f509aa969a6cbd2b27790fa503] | committer: 
James Almer

avformat/apng: fix setting frame delay when max_fps is set to no limit

Reviewed-by: Michael Niedermayer 
Signed-off-by: James Almer 
(cherry picked from commit 874eb012f75bc18bb6d79ad4bc0912afa21751f3)

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

 libavformat/apngdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/apngdec.c b/libavformat/apngdec.c
index bb17896..7a284e3 100644
--- a/libavformat/apngdec.c
+++ b/libavformat/apngdec.c
@@ -269,7 +269,7 @@ static int decode_fctl_chunk(AVFormatContext *s, 
APNGDemuxContext *ctx, AVPacket
 /* default is hundredths of seconds */
 if (!delay_den)
 delay_den = 100;
-if (!delay_num || delay_den / delay_num > ctx->max_fps) {
+if (!delay_num || (ctx->max_fps && delay_den / delay_num > ctx->max_fps)) {
 delay_num = 1;
 delay_den = ctx->default_fps;
 }

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


[FFmpeg-cvslog] avutil/x86util: don' t use movss in VBROADCASTSS macro when src and dst args are the same

2017-03-21 Thread James Almer
ffmpeg | branch: master | James Almer  | Mon Mar 20 19:39:49 
2017 -0300| [d8962ffbd8aaf9485d06eec045b022ba9c39692b] | committer: James Almer

avutil/x86util: don't use movss in VBROADCASTSS macro when src and dst args are 
the same

Reviewed-by: Henrik Gramner 
Signed-off-by: James Almer 

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

 libavutil/x86/x86util.asm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavutil/x86/x86util.asm b/libavutil/x86/x86util.asm
index de7d2d1..fe9a727 100644
--- a/libavutil/x86/x86util.asm
+++ b/libavutil/x86/x86util.asm
@@ -833,7 +833,9 @@
 %if cpuflag(avx)
 vbroadcastss %1, %2
 %else ; sse
+%ifnidn %1, %2
 movss%1, %2
+%endif
 shufps   %1, %1, 0
 %endif
 %endmacro

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


[FFmpeg-cvslog] avformat/apng: fix setting frame delay when max_fps is set to no limit

2017-03-21 Thread James Almer
ffmpeg | branch: master | James Almer  | Mon Mar 20 22:53:00 
2017 -0300| [874eb012f75bc18bb6d79ad4bc0912afa21751f3] | committer: James Almer

avformat/apng: fix setting frame delay when max_fps is set to no limit

Reviewed-by: Michael Niedermayer 
Signed-off-by: James Almer 

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

 libavformat/apngdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/apngdec.c b/libavformat/apngdec.c
index bb17896..7a284e3 100644
--- a/libavformat/apngdec.c
+++ b/libavformat/apngdec.c
@@ -269,7 +269,7 @@ static int decode_fctl_chunk(AVFormatContext *s, 
APNGDemuxContext *ctx, AVPacket
 /* default is hundredths of seconds */
 if (!delay_den)
 delay_den = 100;
-if (!delay_num || delay_den / delay_num > ctx->max_fps) {
+if (!delay_num || (ctx->max_fps && delay_den / delay_num > ctx->max_fps)) {
 delay_num = 1;
 delay_den = ctx->default_fps;
 }

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


[FFmpeg-cvslog] avformat/apng: set max_fps to no limit by default

2017-03-21 Thread James Almer
ffmpeg | branch: master | James Almer  | Mon Mar 20 22:55:11 
2017 -0300| [7bfbb7229971a5220fed07bb931e6ff1030a319a] | committer: James Almer

avformat/apng: set max_fps to no limit by default

Should fix ticket #6252

Reviewed-by: Michael Niedermayer 
Signed-off-by: James Almer 

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

 libavformat/apngdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/apngdec.c b/libavformat/apngdec.c
index 7a284e3..75dcf74 100644
--- a/libavformat/apngdec.c
+++ b/libavformat/apngdec.c
@@ -421,7 +421,7 @@ static const AVOption options[] = {
 { "ignore_loop", "ignore loop setting" , 
offsetof(APNGDemuxContext, ignore_loop),
   AV_OPT_TYPE_BOOL, { .i64 = 1 }  , 0, 1  , 
AV_OPT_FLAG_DECODING_PARAM },
 { "max_fps", "maximum framerate (0 is no limit)"   , 
offsetof(APNGDemuxContext, max_fps),
-  AV_OPT_TYPE_INT, { .i64 = DEFAULT_APNG_FPS }, 0, INT_MAX, 
AV_OPT_FLAG_DECODING_PARAM },
+  AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
 { "default_fps", "default framerate (0 is as fast as possible)", 
offsetof(APNGDemuxContext, default_fps),
   AV_OPT_TYPE_INT, { .i64 = DEFAULT_APNG_FPS }, 0, INT_MAX, 
AV_OPT_FLAG_DECODING_PARAM },
 { NULL },

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


[FFmpeg-cvslog] avio: add a new flag for marking streams seekable by timestamp

2017-03-21 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Tue Sep 27 
15:44:54 2016 +0200| [8ea35af7620e4f73f9e8c072e1c0fac9a04ec161] | committer: 
Anton Khirnov

avio: add a new flag for marking streams seekable by timestamp

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

 doc/APIchanges| 3 +++
 libavformat/avio.h| 5 +
 libavformat/aviobuf.c | 3 +++
 libavformat/version.h | 4 ++--
 4 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index d0ffca2..6fd3959 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -13,6 +13,9 @@ libavutil: 2015-08-28
 
 API changes, most recent first:
 
+2016-xx-xx - xxx - lavf 57.08.0 - avio.h
+  Add AVIO_SEEKABLE_TIME flag.
+
 2016-xx-xx - xxx - lavu 55.22.0 - pixfmt.h
   Add AV_PIX_FMT_YUV(420,422,444)P12.
 
diff --git a/libavformat/avio.h b/libavformat/avio.h
index 5d2f8c2..49721aa 100644
--- a/libavformat/avio.h
+++ b/libavformat/avio.h
@@ -40,6 +40,11 @@
 #define AVIO_SEEKABLE_NORMAL (1 << 0)
 
 /**
+ * Seeking by timestamp with avio_seek_time() is possible.
+ */
+#define AVIO_SEEKABLE_TIME   (1 << 1)
+
+/**
  * Callback for checking whether to abort blocking functions.
  * AVERROR_EXIT is returned in this case by the interrupted
  * function. During blocking operations, callback is called with
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 39a11e2..5cb733d 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -846,6 +846,9 @@ int ffio_fdopen(AVIOContext **s, URLContext *h)
 if(h->prot) {
 (*s)->read_pause = io_read_pause;
 (*s)->read_seek  = io_read_seek;
+
+if (h->prot->url_read_seek)
+(*s)->seekable |= AVIO_SEEKABLE_TIME;
 }
 (*s)->av_class = _avio_class;
 return 0;
diff --git a/libavformat/version.h b/libavformat/version.h
index 1e1105f..a6643a9 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -30,8 +30,8 @@
 #include "libavutil/version.h"
 
 #define LIBAVFORMAT_VERSION_MAJOR 57
-#define LIBAVFORMAT_VERSION_MINOR  7
-#define LIBAVFORMAT_VERSION_MICRO  1
+#define LIBAVFORMAT_VERSION_MINOR  8
+#define LIBAVFORMAT_VERSION_MICRO  0
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \

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


[FFmpeg-cvslog] Merge commit '8ea35af7620e4f73f9e8c072e1c0fac9a04ec161'

2017-03-21 Thread James Almer
ffmpeg | branch: master | James Almer  | Tue Mar 21 17:07:44 
2017 -0300| [fc9f14c7de5bff05bab6f7b258ca70b777ce04ed] | committer: James Almer

Merge commit '8ea35af7620e4f73f9e8c072e1c0fac9a04ec161'

* commit '8ea35af7620e4f73f9e8c072e1c0fac9a04ec161':
  avio: add a new flag for marking streams seekable by timestamp

Merged-by: James Almer 

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

 doc/APIchanges| 3 +++
 libavformat/avio.h| 5 +
 libavformat/aviobuf.c | 3 +++
 libavformat/version.h | 4 ++--
 4 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index aadf164..eccfb70 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,9 @@ libavutil: 2015-08-28
 
 API changes, most recent first:
 
+2017-03-21 - xxx - lavf 57.67.100 / 57.08.0 - avio.h
+  Add AVIO_SEEKABLE_TIME flag.
+
 2017-03-21 - xxx - lavf 57.66.105, lavc 57.83.101 - avformat.h, avcodec.h
   Deprecate AVFMT_FLAG_KEEP_SIDE_DATA. It will be ignored after the next major
   bump, and libavformat will behave as if it were always set.
diff --git a/libavformat/avio.h b/libavformat/avio.h
index cec7fd7..6f4ed84 100644
--- a/libavformat/avio.h
+++ b/libavformat/avio.h
@@ -40,6 +40,11 @@
 #define AVIO_SEEKABLE_NORMAL (1 << 0)
 
 /**
+ * Seeking by timestamp with avio_seek_time() is possible.
+ */
+#define AVIO_SEEKABLE_TIME   (1 << 1)
+
+/**
  * Callback for checking whether to abort blocking functions.
  * AVERROR_EXIT is returned in this case by the interrupted
  * function. During blocking operations, callback is called with
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 5f58ab0..ef6a0d4 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -934,6 +934,9 @@ int ffio_fdopen(AVIOContext **s, URLContext *h)
 if(h->prot) {
 (*s)->read_pause = io_read_pause;
 (*s)->read_seek  = io_read_seek;
+
+if (h->prot->url_read_seek)
+(*s)->seekable |= AVIO_SEEKABLE_TIME;
 }
 (*s)->short_seek_get = io_short_seek;
 (*s)->av_class = _avio_class;
diff --git a/libavformat/version.h b/libavformat/version.h
index bfc42e3..dd4c680 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -32,8 +32,8 @@
 // Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)
 // Also please add any ticket numbers that you believe might be affected here
 #define LIBAVFORMAT_VERSION_MAJOR  57
-#define LIBAVFORMAT_VERSION_MINOR  66
-#define LIBAVFORMAT_VERSION_MICRO 105
+#define LIBAVFORMAT_VERSION_MINOR  67
+#define LIBAVFORMAT_VERSION_MICRO 100
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \


==

diff --cc doc/APIchanges
index aadf164,6fd3959..eccfb70
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@@ -15,12 -13,16 +15,15 @@@ libavutil: 2015-08-2
  
  API changes, most recent first:
  
 -2016-xx-xx - xxx - lavf 57.08.0 - avio.h
++2017-03-21 - xxx - lavf 57.67.100 / 57.08.0 - avio.h
+   Add AVIO_SEEKABLE_TIME flag.
+ 
 -2016-xx-xx - xxx - lavu 55.22.0 - pixfmt.h
 -  Add AV_PIX_FMT_YUV(420,422,444)P12.
 +2017-03-21 - xxx - lavf 57.66.105, lavc 57.83.101 - avformat.h, avcodec.h
 +  Deprecate AVFMT_FLAG_KEEP_SIDE_DATA. It will be ignored after the next major
 +  bump, and libavformat will behave as if it were always set.
 +  Deprecate av_packet_merge_side_data() and av_packet_split_side_data().
  
 -2016-xx-xx - xxx - lavc 57.27.0 - avcodec.h
 -  Add FF_PROFILE_HEVC_REXT, the extended pixel format profile for HEVC.
 -
 -2016-08-24 - xxx - lavu 55.21.0 - imgutils.h
 +2016-03-20 - xxx - lavu 55.50.100 / 55.21.0 - imgutils.h
Add av_image_copy_uc_from(), a version of av_image_copy() for copying
from GPU mapped memory.
  
diff --cc libavformat/aviobuf.c
index 5f58ab0,5cb733d..ef6a0d4
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@@ -934,8 -846,10 +934,11 @@@ int ffio_fdopen(AVIOContext **s, URLCon
  if(h->prot) {
  (*s)->read_pause = io_read_pause;
  (*s)->read_seek  = io_read_seek;
+ 
+ if (h->prot->url_read_seek)
+ (*s)->seekable |= AVIO_SEEKABLE_TIME;
  }
 +(*s)->short_seek_get = io_short_seek;
  (*s)->av_class = _avio_class;
  return 0;
  fail:
diff --cc libavformat/version.h
index bfc42e3,a6643a9..dd4c680
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@@ -29,11 -29,9 +29,11 @@@
  
  #include "libavutil/version.h"
  
 -#define LIBAVFORMAT_VERSION_MAJOR 57
 -#define LIBAVFORMAT_VERSION_MINOR  8
 -#define LIBAVFORMAT_VERSION_MICRO  0
 +// Major bumping may affect Ticket5467, 5421, 5451(compatibility with 
Chromium)
 +// Also please add any ticket numbers that you believe might be affected here
 +#define LIBAVFORMAT_VERSION_MAJOR  57

[FFmpeg-cvslog] Merge commit '75c1db6152c7c90c7ce28c9adb945028e5512c4f'

2017-03-21 Thread James Almer
ffmpeg | branch: master | James Almer  | Tue Mar 21 17:04:44 
2017 -0300| [de36e98a16f495d051e301653115ebf99a7d7929] | committer: James Almer

Merge commit '75c1db6152c7c90c7ce28c9adb945028e5512c4f'

* commit '75c1db6152c7c90c7ce28c9adb945028e5512c4f':
  avio: cosmetics, prettify AVIO_SEEKABLE_NORMAL

Merged-by: James Almer 

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

 libavformat/avio.h | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavformat/avio.h b/libavformat/avio.h
index 8040094..cec7fd7 100644
--- a/libavformat/avio.h
+++ b/libavformat/avio.h
@@ -34,7 +34,10 @@
 
 #include "libavformat/version.h"
 
-#define AVIO_SEEKABLE_NORMAL 0x0001 /**< Seeking works like for a local file */
+/**
+ * Seeking works like for a local file.
+ */
+#define AVIO_SEEKABLE_NORMAL (1 << 0)
 
 /**
  * Callback for checking whether to abort blocking functions.


==


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


[FFmpeg-cvslog] avio: cosmetics, prettify AVIO_SEEKABLE_NORMAL

2017-03-21 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Tue Sep 27 
15:37:54 2016 +0200| [75c1db6152c7c90c7ce28c9adb945028e5512c4f] | committer: 
Anton Khirnov

avio: cosmetics, prettify AVIO_SEEKABLE_NORMAL

Move the doxy above the definition, change the value itself to the
(1 << n) pattern, which is more readable for flags.

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

 libavformat/avio.h | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavformat/avio.h b/libavformat/avio.h
index 4bd5cb1..5d2f8c2 100644
--- a/libavformat/avio.h
+++ b/libavformat/avio.h
@@ -34,8 +34,10 @@
 
 #include "libavformat/version.h"
 
-
-#define AVIO_SEEKABLE_NORMAL 0x0001 /**< Seeking works like for a local file */
+/**
+ * Seeking works like for a local file.
+ */
+#define AVIO_SEEKABLE_NORMAL (1 << 0)
 
 /**
  * Callback for checking whether to abort blocking functions.

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


[FFmpeg-cvslog] lavf: fix usage of AVIOContext.seekable

2017-03-21 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Tue Sep 27 
16:26:37 2016 +0200| [83548fe894cdb455cc127f754d09905b6d23c173] | committer: 
Anton Khirnov

lavf: fix usage of AVIOContext.seekable

It is supposed to be a flag. The only currently defined value is
AVIO_SEEKABLE_NORMAL, but other ones may be added in the future.
However all the current lavf code treats this field as a bool (mainly
for historical reasons).
Change all those cases to properly check for AVIO_SEEKABLE_NORMAL.

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

 libavformat/aiffdec.c  |  2 +-
 libavformat/aiffenc.c  |  2 +-
 libavformat/ape.c  |  2 +-
 libavformat/apetag.c   |  2 +-
 libavformat/asfdec.c   |  8 +---
 libavformat/asfenc.c   |  4 ++--
 libavformat/au.c   |  2 +-
 libavformat/avidec.c   |  5 +++--
 libavformat/avienc.c   | 18 +-
 libavformat/aviobuf.c  |  2 +-
 libavformat/bink.c |  2 +-
 libavformat/cafdec.c   |  4 ++--
 libavformat/filmstripdec.c |  2 +-
 libavformat/flacenc.c  |  2 +-
 libavformat/flvdec.c   |  3 ++-
 libavformat/gxfenc.c   |  2 +-
 libavformat/id3v1.c|  2 +-
 libavformat/matroskadec.c  |  2 +-
 libavformat/matroskaenc.c  | 14 +++---
 libavformat/mmf.c  |  2 +-
 libavformat/mov.c  | 12 ++--
 libavformat/movenc.c   |  2 +-
 libavformat/mp3enc.c   |  2 +-
 libavformat/mpc.c  |  2 +-
 libavformat/mpc8.c |  2 +-
 libavformat/mpeg.c |  2 +-
 libavformat/mpegts.c   |  3 ++-
 libavformat/mvdec.c|  4 ++--
 libavformat/mxfdec.c   |  4 ++--
 libavformat/mxfenc.c   |  2 +-
 libavformat/nutdec.c   |  2 +-
 libavformat/oggdec.c   |  2 +-
 libavformat/r3d.c  |  2 +-
 libavformat/rmdec.c|  3 ++-
 libavformat/rmenc.c|  6 +++---
 libavformat/rsoenc.c   |  2 +-
 libavformat/smjpegenc.c|  2 +-
 libavformat/soxenc.c   |  2 +-
 libavformat/swfenc.c   |  2 +-
 libavformat/takdec.c   |  2 +-
 libavformat/tty.c  |  2 +-
 libavformat/utils.c|  2 +-
 libavformat/vc1testenc.c   |  2 +-
 libavformat/voc_packet.c   |  2 +-
 libavformat/wavdec.c   |  2 +-
 libavformat/wavenc.c   |  4 ++--
 libavformat/wvdec.c|  4 ++--
 libavformat/wvenc.c|  2 +-
 48 files changed, 84 insertions(+), 78 deletions(-)

diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c
index 3c45c61..481a92d 100644
--- a/libavformat/aiffdec.c
+++ b/libavformat/aiffdec.c
@@ -251,7 +251,7 @@ static int aiff_read_header(AVFormatContext *s)
 offset += avio_tell(pb);/* Compute absolute data offset */
 if (st->codecpar->block_align)/* Assume COMM already parsed */
 goto got_sound;
-if (!pb->seekable) {
+if (!(pb->seekable & AVIO_SEEKABLE_NORMAL)) {
 av_log(s, AV_LOG_ERROR, "file is not seekable\n");
 return -1;
 }
diff --git a/libavformat/aiffenc.c b/libavformat/aiffenc.c
index 6449c00..191e746 100644
--- a/libavformat/aiffenc.c
+++ b/libavformat/aiffenc.c
@@ -129,7 +129,7 @@ static int aiff_write_trailer(AVFormatContext *s)
 end_size++;
 }
 
-if (s->pb->seekable) {
+if (s->pb->seekable & AVIO_SEEKABLE_NORMAL) {
 /* File length */
 avio_seek(pb, aiff->form, SEEK_SET);
 avio_wb32(pb, file_size - aiff->form - 4);
diff --git a/libavformat/ape.c b/libavformat/ape.c
index bcc1f7a..80e3372 100644
--- a/libavformat/ape.c
+++ b/libavformat/ape.c
@@ -370,7 +370,7 @@ static int ape_read_header(AVFormatContext * s)
 }
 
 /* try to read APE tags */
-if (pb->seekable) {
+if (pb->seekable & AVIO_SEEKABLE_NORMAL) {
 ff_ape_parse_tag(s);
 avio_seek(pb, 0, SEEK_SET);
 }
diff --git a/libavformat/apetag.c b/libavformat/apetag.c
index 044bfd8..05430dd 100644
--- a/libavformat/apetag.c
+++ b/libavformat/apetag.c
@@ -182,7 +182,7 @@ int ff_ape_write_tag(AVFormatContext *s)
 int64_t start, end;
 int size, count = 0;
 
-if (!s->pb->seekable)
+if (!(s->pb->seekable & AVIO_SEEKABLE_NORMAL))
 return 0;
 
 start = avio_tell(s->pb);
diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
index 7d71789..1c50ad6 100644
--- a/libavformat/asfdec.c
+++ b/libavformat/asfdec.c
@@ -960,7 +960,7 @@ static int asf_read_data(AVFormatContext *s, const 
GUIDParseTable *g)
size, asf->nb_packets);
 avio_skip(pb, 2); // skip reserved field
 asf->first_packet_offset = avio_tell(pb);
-if (pb->seekable && !(asf->b_flags & ASF_FLAG_BROADCAST))
+if ((pb->seekable & AVIO_SEEKABLE_NORMAL) && !(asf->b_flags & 
ASF_FLAG_BROADCAST))
 align_position(pb, asf->offset, asf->data_size);
 
 return 0;
@@ -1738,7 +1738,9 @@ static int asf_read_header(AVFormatContext *s)
 size = avio_rl64(pb);
 

[FFmpeg-cvslog] avcodec/mpegaudiodec_template: Fix 2 runtime error: signed integer overflow

2017-03-21 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Mon 
Mar 20 01:55:39 2017 +0100| [b15818642b4e8c4ea61bf93bc6920e71a834a535] | 
committer: Michael Niedermayer

avcodec/mpegaudiodec_template: Fix 2 runtime error: signed integer overflow

Fixes: 873/clusterfuzz-testcase-5714546230558720

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=b15818642b4e8c4ea61bf93bc6920e71a834a535
---

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

diff --git a/libavcodec/mpegaudiodec_template.c 
b/libavcodec/mpegaudiodec_template.c
index a5ac581..6e94cf7 100644
--- a/libavcodec/mpegaudiodec_template.c
+++ b/libavcodec/mpegaudiodec_template.c
@@ -1038,7 +1038,8 @@ static void compute_stereo(MPADecodeContext *s, 
GranuleDef *g0, GranuleDef *g1)
 {
 int i, j, k, l;
 int sf_max, sf, len, non_zero_found;
-INTFLOAT (*is_tab)[16], *tab0, *tab1, tmp0, tmp1, v1, v2;
+INTFLOAT (*is_tab)[16], *tab0, *tab1, v1, v2;
+SUINTFLOAT tmp0, tmp1;
 int non_zero_found_short[3];
 
 /* intensity stereo */

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


[FFmpeg-cvslog] Merge commit '8d1267932ca9c2e343ef303349101bab6681d02e'

2017-03-21 Thread James Almer
ffmpeg | branch: master | James Almer  | Tue Mar 21 16:10:33 
2017 -0300| [387d96fcf54bb8361195fe8ac2c6688d35d5313f] | committer: James Almer

Merge commit '8d1267932ca9c2e343ef303349101bab6681d02e'

* commit '8d1267932ca9c2e343ef303349101bab6681d02e':
  x86/h264_weight: use appropriate register size for weight parameters

This commit is a noop, see 5ae0ad001a653e71b14c92a0d7861de87901752c

Merged-by: James Almer 

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



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


[FFmpeg-cvslog] x86/h264_weight: use appropriate register size for weight parameters

2017-03-21 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Fri Sep 23 
09:52:48 2016 +0200| [8d1267932ca9c2e343ef303349101bab6681d02e] | committer: 
Martin Storsjö

x86/h264_weight: use appropriate register size for weight parameters

This fixes decoding corruption on 64 bit windows.

Signed-off-by: Martin Storsjö 

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

 libavcodec/x86/h264_weight.asm | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/libavcodec/x86/h264_weight.asm b/libavcodec/x86/h264_weight.asm
index 9ad26de..e421ec8 100644
--- a/libavcodec/x86/h264_weight.asm
+++ b/libavcodec/x86/h264_weight.asm
@@ -134,16 +134,16 @@ WEIGHT_FUNC_HALF_MM 8, 8
 mov  off_regd, r7m
 add  off_regd, 1
 or   off_regd, 1
-addr4, 1
-cmpr6d, 128
+add   r4d, 1
+cmp   r6d, 128
 je .nonnormal
-cmpr5, 128
+cmp   r5d, 128
 jne .normal
 .nonnormal
-sarr5, 1
-sarr6, 1
+sar   r5d, 1
+sar   r6d, 1
 sar  off_regd, 1
-subr4, 1
+sub   r4d, 1
 .normal
 %if cpuflag(ssse3)
 movd   m4, r5d

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


[FFmpeg-cvslog] mpegaudiodsp: Change type of array stride parameters to ptrdiff_t

2017-03-21 Thread Diego Biurrun
ffmpeg | branch: master | Diego Biurrun  | Tue Sep 20 
14:09:43 2016 +0200| [2caa93b813adc5dbb7771dfe615da826a2947d18] | committer: 
Diego Biurrun

mpegaudiodsp: Change type of array stride parameters to ptrdiff_t

This avoids SIMD-optimized functions having to sign-extend their
stride argument manually to be able to do pointer arithmetic.

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

 libavcodec/aarch64/mpegaudiodsp_neon.S |  1 -
 libavcodec/mpegaudiodsp.h  | 16 ++--
 libavcodec/mpegaudiodsp_template.c |  4 ++--
 libavcodec/ppc/mpegaudiodsp_altivec.c  |  2 +-
 libavcodec/x86/mpegaudiodsp.c  |  2 +-
 5 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/libavcodec/aarch64/mpegaudiodsp_neon.S 
b/libavcodec/aarch64/mpegaudiodsp_neon.S
index c1edc64..34181d9 100644
--- a/libavcodec/aarch64/mpegaudiodsp_neon.S
+++ b/libavcodec/aarch64/mpegaudiodsp_neon.S
@@ -34,7 +34,6 @@ endconst
 .macro   apply_window   type, st
 function ff_mpadsp_apply_window_\type\()_neon, export=1
 mov x7,  x0
-sxtwx4,  w4  // incr
 add x8,  x0,  #512<<2
 ld1 {v0.4s,v1.4s,v2.4s,v3.4s},  [x7],  #64
 ld1 {v4.4s,v5.4s,v6.4s,v7.4s},  [x7],  #64
diff --git a/libavcodec/mpegaudiodsp.h b/libavcodec/mpegaudiodsp.h
index 909c652..e0e872f 100644
--- a/libavcodec/mpegaudiodsp.h
+++ b/libavcodec/mpegaudiodsp.h
@@ -19,14 +19,18 @@
 #ifndef AVCODEC_MPEGAUDIODSP_H
 #define AVCODEC_MPEGAUDIODSP_H
 
+#include 
 #include 
+
 #include "libavutil/common.h"
 
 typedef struct MPADSPContext {
 void (*apply_window_float)(float *synth_buf, float *window,
-   int *dither_state, float *samples, int incr);
+   int *dither_state, float *samples,
+   ptrdiff_t incr);
 void (*apply_window_fixed)(int32_t *synth_buf, int32_t *window,
-   int *dither_state, int16_t *samples, int incr);
+   int *dither_state, int16_t *samples,
+   ptrdiff_t incr);
 void (*dct32_float)(float *dst, const float *src);
 void (*dct32_fixed)(int *dst, const int *src);
 void (*imdct36_blocks_float)(float *out, float *buf, float *in,
@@ -45,13 +49,13 @@ extern const int32_t ff_mpa_enwindow[257];
 void ff_mpa_synth_filter_fixed(MPADSPContext *s,
int32_t *synth_buf_ptr, int *synth_buf_offset,
int32_t *window, int *dither_state,
-   int16_t *samples, int incr,
+   int16_t *samples, ptrdiff_t incr,
int32_t *sb_samples);
 
 void ff_mpa_synth_filter_float(MPADSPContext *s,
float *synth_buf_ptr, int *synth_buf_offset,
float *window, int *dither_state,
-   float *samples, int incr,
+   float *samples, ptrdiff_t incr,
float *sb_samples);
 
 void ff_mpadsp_init_aarch64(MPADSPContext *s);
@@ -64,10 +68,10 @@ void ff_mpa_synth_init_fixed(int32_t *window);
 
 void ff_mpadsp_apply_window_float(float *synth_buf, float *window,
   int *dither_state, float *samples,
-  int incr);
+  ptrdiff_t incr);
 void ff_mpadsp_apply_window_fixed(int32_t *synth_buf, int32_t *window,
   int *dither_state, int16_t *samples,
-  int incr);
+  ptrdiff_t incr);
 
 void ff_imdct36_blocks_float(float *out, float *buf, float *in,
  int count, int switch_point, int block_type);
diff --git a/libavcodec/mpegaudiodsp_template.c 
b/libavcodec/mpegaudiodsp_template.c
index 621bbd4..b8836c9 100644
--- a/libavcodec/mpegaudiodsp_template.c
+++ b/libavcodec/mpegaudiodsp_template.c
@@ -120,7 +120,7 @@ DECLARE_ALIGNED(16, MPA_INT, 
RENAME(ff_mpa_synth_window))[512+256];
 
 void RENAME(ff_mpadsp_apply_window)(MPA_INT *synth_buf, MPA_INT *window,
   int *dither_state, OUT_INT *samples,
-  int incr)
+  ptrdiff_t incr)
 {
 register const MPA_INT *w, *w2, *p;
 int j;
@@ -176,7 +176,7 @@ void RENAME(ff_mpadsp_apply_window)(MPA_INT *synth_buf, 
MPA_INT *window,
 void RENAME(ff_mpa_synth_filter)(MPADSPContext *s, MPA_INT *synth_buf_ptr,
  int *synth_buf_offset,
  MPA_INT *window, int *dither_state,
- OUT_INT *samples, int incr,
+ OUT_INT *samples, ptrdiff_t incr,
  MPA_INT 

[FFmpeg-cvslog] mss*: Change type of array stride parameters to ptrdiff_t

2017-03-21 Thread Diego Biurrun
ffmpeg | branch: master | Diego Biurrun  | Thu Sep  8 
16:03:46 2016 +0200| [15b4f494fc6bddb8178fdb5aed18b420efc75e22] | committer: 
Diego Biurrun

mss*: Change type of array stride parameters to ptrdiff_t

ptrdiff_t is the correct type for array strides and similar.

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

 libavcodec/mss12.c| 15 ---
 libavcodec/mss12.h|  6 +++---
 libavcodec/mss2.c |  6 +++---
 libavcodec/mss2dsp.c  | 28 ++--
 libavcodec/mss2dsp.h  | 22 --
 libavcodec/mss3.c | 12 ++--
 libavcodec/mss34dsp.c |  2 +-
 libavcodec/mss34dsp.h |  3 ++-
 libavcodec/mss4.c |  2 +-
 9 files changed, 50 insertions(+), 46 deletions(-)

diff --git a/libavcodec/mss12.c b/libavcodec/mss12.c
index b9bda16..8735b85 100644
--- a/libavcodec/mss12.c
+++ b/libavcodec/mss12.c
@@ -197,7 +197,7 @@ static av_always_inline int decode_pixel(ArithCoder 
*acoder, PixContext *pctx,
 }
 
 static int decode_pixel_in_context(ArithCoder *acoder, PixContext *pctx,
-   uint8_t *src, int stride, int x, int y,
+   uint8_t *src, ptrdiff_t stride, int x, int 
y,
int has_right)
 {
 uint8_t neighbours[4];
@@ -290,8 +290,9 @@ static int decode_pixel_in_context(ArithCoder *acoder, 
PixContext *pctx,
 }
 
 static int decode_region(ArithCoder *acoder, uint8_t *dst, uint8_t *rgb_pic,
- int x, int y, int width, int height, int stride,
- int rgb_stride, PixContext *pctx, const uint32_t *pal)
+ int x, int y, int width, int height, ptrdiff_t stride,
+ ptrdiff_t rgb_stride, PixContext *pctx,
+ const uint32_t *pal)
 {
 int i, j, p;
 uint8_t *rgb_dst = rgb_pic + x * 3 + y * rgb_stride;
@@ -368,8 +369,8 @@ static int motion_compensation(MSS12Context const *c,
 }
 
 static int decode_region_masked(MSS12Context const *c, ArithCoder *acoder,
-uint8_t *dst, int stride, uint8_t *mask,
-int mask_stride, int x, int y,
+uint8_t *dst, ptrdiff_t stride, uint8_t *mask,
+ptrdiff_t mask_stride, int x, int y,
 int width, int height,
 PixContext *pctx)
 {
@@ -466,8 +467,8 @@ static int decode_region_intra(SliceContext *sc, ArithCoder 
*acoder,
 
 if (!mode) {
 int i, j, pix, rgb_pix;
-int stride   = c->pal_stride;
-int rgb_stride   = c->rgb_stride;
+ptrdiff_t stride = c->pal_stride;
+ptrdiff_t rgb_stride = c->rgb_stride;
 uint8_t *dst = c->pal_pic + x + y * stride;
 uint8_t *rgb_dst = c->rgb_pic + x * 3 + y * rgb_stride;
 
diff --git a/libavcodec/mss12.h b/libavcodec/mss12.h
index 5b1fee8..8cad5dc 100644
--- a/libavcodec/mss12.h
+++ b/libavcodec/mss12.h
@@ -77,12 +77,12 @@ typedef struct MSS12Context {
 uint32_t   pal[256];
 uint8_t*pal_pic;
 uint8_t*last_pal_pic;
-intpal_stride;
+ptrdiff_t  pal_stride;
 uint8_t*mask;
-intmask_stride;
+ptrdiff_t  mask_stride;
 uint8_t*rgb_pic;
 uint8_t*last_rgb_pic;
-intrgb_stride;
+ptrdiff_t  rgb_stride;
 intfree_colours;
 intkeyframe;
 intmvX, mvY;
diff --git a/libavcodec/mss2.c b/libavcodec/mss2.c
index 866ce47..355bb32 100644
--- a/libavcodec/mss2.c
+++ b/libavcodec/mss2.c
@@ -174,7 +174,7 @@ static int decode_pal_v2(MSS12Context *ctx, const uint8_t 
*buf, int buf_size)
 return 1 + ncol * 3;
 }
 
-static int decode_555(GetByteContext *gB, uint16_t *dst, int stride,
+static int decode_555(GetByteContext *gB, uint16_t *dst, ptrdiff_t stride,
   int keyframe, int w, int h)
 {
 int last_symbol = 0, repeat = 0, prev_avail = 0;
@@ -232,8 +232,8 @@ static int decode_555(GetByteContext *gB, uint16_t *dst, 
int stride,
 return 0;
 }
 
-static int decode_rle(GetBitContext *gb, uint8_t *pal_dst, int pal_stride,
-  uint8_t *rgb_dst, int rgb_stride, uint32_t *pal,
+static int decode_rle(GetBitContext *gb, uint8_t *pal_dst, ptrdiff_t 
pal_stride,
+  uint8_t *rgb_dst, ptrdiff_t rgb_stride, uint32_t *pal,
   int keyframe, int kf_slipt, int slice, int w, int h)
 {
 uint8_t bits[270] = { 0 };
diff --git a/libavcodec/mss2dsp.c b/libavcodec/mss2dsp.c
index aa13577..4de4dba 100644
--- a/libavcodec/mss2dsp.c
+++ b/libavcodec/mss2dsp.c
@@ -27,17 +27,17 @@
 #include "libavutil/common.h"
 
 static av_always_inline void mss2_blit_wmv9_template(uint8_t *dst,
- int dst_stride,

[FFmpeg-cvslog] Merge commit '15b4f494fc6bddb8178fdb5aed18b420efc75e22'

2017-03-21 Thread James Almer
ffmpeg | branch: master | James Almer  | Tue Mar 21 15:57:07 
2017 -0300| [a0478341f34be544e28b83ecfd768922de309416] | committer: James Almer

Merge commit '15b4f494fc6bddb8178fdb5aed18b420efc75e22'

* commit '15b4f494fc6bddb8178fdb5aed18b420efc75e22':
  mss*: Change type of array stride parameters to ptrdiff_t

Merged-by: James Almer 

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

 libavcodec/mss12.c| 15 ---
 libavcodec/mss12.h|  6 +++---
 libavcodec/mss2.c |  6 +++---
 libavcodec/mss2dsp.c  | 28 ++--
 libavcodec/mss2dsp.h  | 22 --
 libavcodec/mss3.c | 12 ++--
 libavcodec/mss34dsp.c |  2 +-
 libavcodec/mss34dsp.h |  3 ++-
 libavcodec/mss4.c |  2 +-
 9 files changed, 50 insertions(+), 46 deletions(-)

diff --git a/libavcodec/mss12.c b/libavcodec/mss12.c
index d42093b..3b1a302 100644
--- a/libavcodec/mss12.c
+++ b/libavcodec/mss12.c
@@ -197,7 +197,7 @@ static av_always_inline int decode_pixel(ArithCoder 
*acoder, PixContext *pctx,
 }
 
 static int decode_pixel_in_context(ArithCoder *acoder, PixContext *pctx,
-   uint8_t *src, int stride, int x, int y,
+   uint8_t *src, ptrdiff_t stride, int x, int 
y,
int has_right)
 {
 uint8_t neighbours[4];
@@ -290,8 +290,9 @@ static int decode_pixel_in_context(ArithCoder *acoder, 
PixContext *pctx,
 }
 
 static int decode_region(ArithCoder *acoder, uint8_t *dst, uint8_t *rgb_pic,
- int x, int y, int width, int height, int stride,
- int rgb_stride, PixContext *pctx, const uint32_t *pal)
+ int x, int y, int width, int height, ptrdiff_t stride,
+ ptrdiff_t rgb_stride, PixContext *pctx,
+ const uint32_t *pal)
 {
 int i, j, p;
 uint8_t *rgb_dst = rgb_pic + x * 3 + y * rgb_stride;
@@ -368,8 +369,8 @@ static int motion_compensation(MSS12Context const *c,
 }
 
 static int decode_region_masked(MSS12Context const *c, ArithCoder *acoder,
-uint8_t *dst, int stride, uint8_t *mask,
-int mask_stride, int x, int y,
+uint8_t *dst, ptrdiff_t stride, uint8_t *mask,
+ptrdiff_t mask_stride, int x, int y,
 int width, int height,
 PixContext *pctx)
 {
@@ -466,8 +467,8 @@ static int decode_region_intra(SliceContext *sc, ArithCoder 
*acoder,
 
 if (!mode) {
 int i, j, pix, rgb_pix;
-int stride   = c->pal_stride;
-int rgb_stride   = c->rgb_stride;
+ptrdiff_t stride = c->pal_stride;
+ptrdiff_t rgb_stride = c->rgb_stride;
 uint8_t *dst = c->pal_pic + x + y * stride;
 uint8_t *rgb_dst = c->rgb_pic + x * 3 + y * rgb_stride;
 
diff --git a/libavcodec/mss12.h b/libavcodec/mss12.h
index f953167..45c4074 100644
--- a/libavcodec/mss12.h
+++ b/libavcodec/mss12.h
@@ -77,12 +77,12 @@ typedef struct MSS12Context {
 uint32_t   pal[256];
 uint8_t*pal_pic;
 uint8_t*last_pal_pic;
-intpal_stride;
+ptrdiff_t  pal_stride;
 uint8_t*mask;
-intmask_stride;
+ptrdiff_t  mask_stride;
 uint8_t*rgb_pic;
 uint8_t*last_rgb_pic;
-intrgb_stride;
+ptrdiff_t  rgb_stride;
 intfree_colours;
 intkeyframe;
 intmvX, mvY;
diff --git a/libavcodec/mss2.c b/libavcodec/mss2.c
index 581865b..9e7cc46 100644
--- a/libavcodec/mss2.c
+++ b/libavcodec/mss2.c
@@ -174,7 +174,7 @@ static int decode_pal_v2(MSS12Context *ctx, const uint8_t 
*buf, int buf_size)
 return 1 + ncol * 3;
 }
 
-static int decode_555(GetByteContext *gB, uint16_t *dst, int stride,
+static int decode_555(GetByteContext *gB, uint16_t *dst, ptrdiff_t stride,
   int keyframe, int w, int h)
 {
 int last_symbol = 0, repeat = 0, prev_avail = 0;
@@ -237,8 +237,8 @@ static int decode_555(GetByteContext *gB, uint16_t *dst, 
int stride,
 return 0;
 }
 
-static int decode_rle(GetBitContext *gb, uint8_t *pal_dst, int pal_stride,
-  uint8_t *rgb_dst, int rgb_stride, uint32_t *pal,
+static int decode_rle(GetBitContext *gb, uint8_t *pal_dst, ptrdiff_t 
pal_stride,
+  uint8_t *rgb_dst, ptrdiff_t rgb_stride, uint32_t *pal,
   int keyframe, int kf_slipt, int slice, int w, int h)
 {
 uint8_t bits[270] = { 0 };
diff --git a/libavcodec/mss2dsp.c b/libavcodec/mss2dsp.c
index c5fc1f8..cc39dd6 100644
--- a/libavcodec/mss2dsp.c
+++ b/libavcodec/mss2dsp.c
@@ -27,17 +27,17 @@
 #include "libavutil/common.h"
 
 static av_always_inline void 

[FFmpeg-cvslog] Merge commit 'a339e919cad1ab0125948f0dd9d49f6cb590db89'

2017-03-21 Thread James Almer
ffmpeg | branch: master | James Almer  | Tue Mar 21 15:55:44 
2017 -0300| [b16752f694a5b580a8188fa2ef428a6afbb229d7] | committer: James Almer

Merge commit 'a339e919cad1ab0125948f0dd9d49f6cb590db89'

* commit 'a339e919cad1ab0125948f0dd9d49f6cb590db89':
  ea: Change type of array stride parameters to ptrdiff_t

Merged-by: James Almer 

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

 libavcodec/eacmv.c  | 4 ++--
 libavcodec/eaidct.c | 3 ++-
 libavcodec/eaidct.h | 3 ++-
 libavcodec/eamad.c  | 4 ++--
 libavcodec/eatgq.c  | 6 +++---
 libavcodec/eatgv.c  | 2 +-
 libavcodec/eatqi.c  | 2 +-
 7 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/libavcodec/eacmv.c b/libavcodec/eacmv.c
index 047be81..bf4404c 100644
--- a/libavcodec/eacmv.c
+++ b/libavcodec/eacmv.c
@@ -72,8 +72,8 @@ static void cmv_decode_intra(CmvContext * s, AVFrame *frame,
 }
 }
 
-static void cmv_motcomp(unsigned char *dst, int dst_stride,
-const unsigned char *src, int src_stride,
+static void cmv_motcomp(unsigned char *dst, ptrdiff_t dst_stride,
+const unsigned char *src, ptrdiff_t src_stride,
 int x, int y,
 int xoffset, int yoffset,
 int width, int height){
diff --git a/libavcodec/eaidct.c b/libavcodec/eaidct.c
index e4840f2..038ee2a 100644
--- a/libavcodec/eaidct.c
+++ b/libavcodec/eaidct.c
@@ -77,7 +77,8 @@ static inline void ea_idct_col(int16_t *dest, const int16_t 
*src) {
 IDCT_COL(dest, src);
 }
 
-void ff_ea_idct_put_c(uint8_t *dest, int linesize, int16_t *block) {
+void ff_ea_idct_put_c(uint8_t *dest, ptrdiff_t linesize, int16_t *block)
+{
 int i;
 int16_t temp[64];
 block[0] += 4;
diff --git a/libavcodec/eaidct.h b/libavcodec/eaidct.h
index 6b9ec1c..a46dae9 100644
--- a/libavcodec/eaidct.h
+++ b/libavcodec/eaidct.h
@@ -19,8 +19,9 @@
 #ifndef AVCODEC_EAIDCT_H
 #define AVCODEC_EAIDCT_H
 
+#include 
 #include 
 
-void ff_ea_idct_put_c(uint8_t *dest, int linesize, int16_t *block);
+void ff_ea_idct_put_c(uint8_t *dest, ptrdiff_t linesize, int16_t *block);
 
 #endif /* AVCODEC_EAIDCT_H */
diff --git a/libavcodec/eamad.c b/libavcodec/eamad.c
index bb0f005..23b1a3c 100644
--- a/libavcodec/eamad.c
+++ b/libavcodec/eamad.c
@@ -80,8 +80,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
 return 0;
 }
 
-static inline void comp(unsigned char *dst, int dst_stride,
-unsigned char *src, int src_stride, int add)
+static inline void comp(unsigned char *dst, ptrdiff_t dst_stride,
+unsigned char *src, ptrdiff_t src_stride, int add)
 {
 int j, i;
 for (j=0; j<8; j++)
diff --git a/libavcodec/eatgq.c b/libavcodec/eatgq.c
index a43d688..1308c07 100644
--- a/libavcodec/eatgq.c
+++ b/libavcodec/eatgq.c
@@ -107,7 +107,7 @@ static void tgq_decode_block(TgqContext *s, int16_t 
block[64], GetBitContext *gb
 static void tgq_idct_put_mb(TgqContext *s, int16_t (*block)[64], AVFrame 
*frame,
 int mb_x, int mb_y)
 {
-int linesize = frame->linesize[0];
+ptrdiff_t linesize = frame->linesize[0];
 uint8_t *dest_y  = frame->data[0] + (mb_y * 16 * linesize)   + 
mb_x * 16;
 uint8_t *dest_cb = frame->data[1] + (mb_y * 8  * frame->linesize[1]) + 
mb_x * 8;
 uint8_t *dest_cr = frame->data[2] + (mb_y * 8  * frame->linesize[2]) + 
mb_x * 8;
@@ -123,7 +123,7 @@ static void tgq_idct_put_mb(TgqContext *s, int16_t 
(*block)[64], AVFrame *frame,
 }
 
 static inline void tgq_dconly(TgqContext *s, unsigned char *dst,
-  int dst_stride, int dc)
+  ptrdiff_t dst_stride, int dc)
 {
 int level = av_clip_uint8((dc*s->qtable[0] + 2056) >> 4);
 int j;
@@ -134,7 +134,7 @@ static inline void tgq_dconly(TgqContext *s, unsigned char 
*dst,
 static void tgq_idct_put_mb_dconly(TgqContext *s, AVFrame *frame,
int mb_x, int mb_y, const int8_t *dc)
 {
-int linesize = frame->linesize[0];
+ptrdiff_t linesize = frame->linesize[0];
 uint8_t *dest_y  = frame->data[0] + (mb_y * 16 * linesize) + 
mb_x * 16;
 uint8_t *dest_cb = frame->data[1] + (mb_y * 8  * frame->linesize[1]) + 
mb_x * 8;
 uint8_t *dest_cr = frame->data[2] + (mb_y * 8  * frame->linesize[2]) + 
mb_x * 8;
diff --git a/libavcodec/eatgv.c b/libavcodec/eatgv.c
index 60399c5..93e291f 100644
--- a/libavcodec/eatgv.c
+++ b/libavcodec/eatgv.c
@@ -227,7 +227,7 @@ static int tgv_decode_inter(TgvContext *s, AVFrame *frame,
 for (x = 0; x < s->avctx->width / 4; x++) {
 unsigned int vector = get_bits(, vector_bits);
 const uint8_t *src;
-int src_stride;
+ptrdiff_t src_stride;
 
 if (vector < num_mvs) {
 int mx = x * 4 + s->mv_codebook[vector][0];
diff --git 

[FFmpeg-cvslog] ea: Change type of array stride parameters to ptrdiff_t

2017-03-21 Thread Diego Biurrun
ffmpeg | branch: master | Diego Biurrun  | Wed Sep  7 
17:08:15 2016 +0200| [a339e919cad1ab0125948f0dd9d49f6cb590db89] | committer: 
Diego Biurrun

ea: Change type of array stride parameters to ptrdiff_t

ptrdiff_t is the correct type for array strides and similar.

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

 libavcodec/eacmv.c  | 4 ++--
 libavcodec/eaidct.c | 3 ++-
 libavcodec/eaidct.h | 3 ++-
 libavcodec/eamad.c  | 4 ++--
 libavcodec/eatgq.c  | 6 +++---
 libavcodec/eatgv.c  | 2 +-
 libavcodec/eatqi.c  | 2 +-
 7 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/libavcodec/eacmv.c b/libavcodec/eacmv.c
index 9668f64..633c26a 100644
--- a/libavcodec/eacmv.c
+++ b/libavcodec/eacmv.c
@@ -71,8 +71,8 @@ static void cmv_decode_intra(CmvContext * s, AVFrame *frame,
 }
 }
 
-static void cmv_motcomp(unsigned char *dst, int dst_stride,
-const unsigned char *src, int src_stride,
+static void cmv_motcomp(unsigned char *dst, ptrdiff_t dst_stride,
+const unsigned char *src, ptrdiff_t src_stride,
 int x, int y,
 int xoffset, int yoffset,
 int width, int height){
diff --git a/libavcodec/eaidct.c b/libavcodec/eaidct.c
index 5b2db44..271e28c 100644
--- a/libavcodec/eaidct.c
+++ b/libavcodec/eaidct.c
@@ -77,7 +77,8 @@ static inline void ea_idct_col(int16_t *dest, const int16_t 
*src) {
 IDCT_COL(dest, src);
 }
 
-void ff_ea_idct_put_c(uint8_t *dest, int linesize, int16_t *block) {
+void ff_ea_idct_put_c(uint8_t *dest, ptrdiff_t linesize, int16_t *block)
+{
 int i;
 int16_t temp[64];
 block[0] += 4;
diff --git a/libavcodec/eaidct.h b/libavcodec/eaidct.h
index e78de04..395a8ae 100644
--- a/libavcodec/eaidct.h
+++ b/libavcodec/eaidct.h
@@ -19,8 +19,9 @@
 #ifndef AVCODEC_EAIDCT_H
 #define AVCODEC_EAIDCT_H
 
+#include 
 #include 
 
-void ff_ea_idct_put_c(uint8_t *dest, int linesize, int16_t *block);
+void ff_ea_idct_put_c(uint8_t *dest, ptrdiff_t linesize, int16_t *block);
 
 #endif /* AVCODEC_EAIDCT_H */
diff --git a/libavcodec/eamad.c b/libavcodec/eamad.c
index 3e8d4fd..070cfdb 100644
--- a/libavcodec/eamad.c
+++ b/libavcodec/eamad.c
@@ -80,8 +80,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
 return 0;
 }
 
-static inline void comp(unsigned char *dst, int dst_stride,
-unsigned char *src, int src_stride, int add)
+static inline void comp(unsigned char *dst, ptrdiff_t dst_stride,
+unsigned char *src, ptrdiff_t src_stride, int add)
 {
 int j, i;
 for (j=0; j<8; j++)
diff --git a/libavcodec/eatgq.c b/libavcodec/eatgq.c
index ff0aa55..8355471 100644
--- a/libavcodec/eatgq.c
+++ b/libavcodec/eatgq.c
@@ -107,7 +107,7 @@ static void tgq_decode_block(TgqContext *s, int16_t 
block[64], GetBitContext *gb
 static void tgq_idct_put_mb(TgqContext *s, int16_t (*block)[64], AVFrame 
*frame,
 int mb_x, int mb_y)
 {
-int linesize = frame->linesize[0];
+ptrdiff_t linesize = frame->linesize[0];
 uint8_t *dest_y  = frame->data[0] + (mb_y * 16 * linesize)   + 
mb_x * 16;
 uint8_t *dest_cb = frame->data[1] + (mb_y * 8  * frame->linesize[1]) + 
mb_x * 8;
 uint8_t *dest_cr = frame->data[2] + (mb_y * 8  * frame->linesize[2]) + 
mb_x * 8;
@@ -123,7 +123,7 @@ static void tgq_idct_put_mb(TgqContext *s, int16_t 
(*block)[64], AVFrame *frame,
 }
 
 static inline void tgq_dconly(TgqContext *s, unsigned char *dst,
-  int dst_stride, int dc)
+  ptrdiff_t dst_stride, int dc)
 {
 int level = av_clip_uint8((dc*s->qtable[0] + 2056) >> 4);
 int j;
@@ -134,7 +134,7 @@ static inline void tgq_dconly(TgqContext *s, unsigned char 
*dst,
 static void tgq_idct_put_mb_dconly(TgqContext *s, AVFrame *frame,
int mb_x, int mb_y, const int8_t *dc)
 {
-int linesize = frame->linesize[0];
+ptrdiff_t linesize = frame->linesize[0];
 uint8_t *dest_y  = frame->data[0] + (mb_y * 16 * linesize) + 
mb_x * 16;
 uint8_t *dest_cb = frame->data[1] + (mb_y * 8  * frame->linesize[1]) + 
mb_x * 8;
 uint8_t *dest_cr = frame->data[2] + (mb_y * 8  * frame->linesize[2]) + 
mb_x * 8;
diff --git a/libavcodec/eatgv.c b/libavcodec/eatgv.c
index 7f40f45..7a50d01 100644
--- a/libavcodec/eatgv.c
+++ b/libavcodec/eatgv.c
@@ -225,7 +225,7 @@ static int tgv_decode_inter(TgvContext *s, AVFrame *frame,
 for (x = 0; x < s->avctx->width / 4; x++) {
 unsigned int vector = get_bits(, vector_bits);
 const uint8_t *src;
-int src_stride;
+ptrdiff_t src_stride;
 
 if (vector < num_mvs) {
 int mx = x * 4 + s->mv_codebook[vector][0];
diff --git a/libavcodec/eatqi.c b/libavcodec/eatqi.c
index f4cad9c..cb70cda 100644
--- a/libavcodec/eatqi.c
+++ 

[FFmpeg-cvslog] hevc: Change type of array stride parameters to ptrdiff_t

2017-03-21 Thread Diego Biurrun
ffmpeg | branch: master | Diego Biurrun  | Thu Sep  1 
22:18:22 2016 +0200| [ba479f3daafc7e4359ec1212164569ebe59f0bb7] | committer: 
Diego Biurrun

hevc: Change type of array stride parameters to ptrdiff_t

ptrdiff_t is the correct type for array strides and similar.

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

 libavcodec/hevc.c | 12 ++--
 libavcodec/hevc_filter.c  |  4 ++--
 libavcodec/hevcdsp_template.c | 36 ++--
 tests/checkasm/hevc_mc.c  | 16 
 4 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index 961991f..e38d367 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -1437,11 +1437,11 @@ static int hls_pcm_sample(HEVCContext *s, int x0, int 
y0, int log2_cb_size)
 HEVCLocalContext *lc = >HEVClc;
 GetBitContext gb;
 int cb_size   = 1 << log2_cb_size;
-int stride0   = s->frame->linesize[0];
+ptrdiff_t stride0 = s->frame->linesize[0];
+ptrdiff_t stride1 = s->frame->linesize[1];
+ptrdiff_t stride2 = s->frame->linesize[2];
 uint8_t *dst0 = >frame->data[0][y0 * stride0 + (x0 << 
s->ps.sps->pixel_shift)];
-int   stride1 = s->frame->linesize[1];
 uint8_t *dst1 = >frame->data[1][(y0 >> s->ps.sps->vshift[1]) * stride1 
+ ((x0 >> s->ps.sps->hshift[1]) << s->ps.sps->pixel_shift)];
-int   stride2 = s->frame->linesize[2];
 uint8_t *dst2 = >frame->data[2][(y0 >> s->ps.sps->vshift[2]) * stride2 
+ ((x0 >> s->ps.sps->hshift[2]) << s->ps.sps->pixel_shift)];
 
 int length = cb_size * cb_size * s->ps.sps->pcm.bit_depth + 
((cb_size * cb_size) >> 1) * s->ps.sps->pcm.bit_depth_chroma;
@@ -1520,7 +1520,7 @@ static void luma_mc(HEVCContext *s, int16_t *dst, 
ptrdiff_t dststride,
 if (x_off < extra_left || y_off < extra_top ||
 x_off >= pic_width - block_w - ff_hevc_qpel_extra_after[mx] ||
 y_off >= pic_height - block_h - ff_hevc_qpel_extra_after[my]) {
-const int edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << 
s->ps.sps->pixel_shift;
+const ptrdiff_t edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << 
s->ps.sps->pixel_shift;
 int offset = extra_top * srcstride + (extra_left << 
s->ps.sps->pixel_shift);
 int buf_offset = extra_top *
  edge_emu_stride + (extra_left << 
s->ps.sps->pixel_shift);
@@ -1575,7 +1575,7 @@ static void chroma_mc(HEVCContext *s, int16_t *dst1, 
int16_t *dst2,
 if (x_off < EPEL_EXTRA_BEFORE || y_off < EPEL_EXTRA_AFTER ||
 x_off >= pic_width - block_w - EPEL_EXTRA_AFTER ||
 y_off >= pic_height - block_h - EPEL_EXTRA_AFTER) {
-const int edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << 
s->ps.sps->pixel_shift;
+const ptrdiff_t edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << 
s->ps.sps->pixel_shift;
 int offset1 = EPEL_EXTRA_BEFORE * (src1stride + (1 << 
s->ps.sps->pixel_shift));
 int buf_offset1 = EPEL_EXTRA_BEFORE *
   (edge_emu_stride + (1 << s->ps.sps->pixel_shift));
@@ -1687,7 +1687,7 @@ static void hls_prediction_unit(HEVCContext *s, int x0, 
int y0,
 RefPicList  *refPicList = s->ref->refPicList;
 HEVCFrame *ref0, *ref1;
 
-int tmpstride = MAX_PB_SIZE * sizeof(int16_t);
+ptrdiff_t tmpstride = MAX_PB_SIZE * sizeof(int16_t);
 
 uint8_t *dst0 = POS(0, x0, y0);
 uint8_t *dst1 = POS(1, x0, y0);
diff --git a/libavcodec/hevc_filter.c b/libavcodec/hevc_filter.c
index 39ac4ee..5037dae 100644
--- a/libavcodec/hevc_filter.c
+++ b/libavcodec/hevc_filter.c
@@ -172,7 +172,7 @@ static int get_qPy(HEVCContext *s, int xC, int yC)
 }
 
 static void copy_CTB(uint8_t *dst, uint8_t *src,
- int width, int height, int stride)
+ int width, int height, ptrdiff_t stride)
 {
 int i;
 
@@ -273,7 +273,7 @@ static void sao_filter_CTB(HEVCContext *s, int x, int y)
 int chroma = c_idx ? 1 : 0;
 int x0 = x >> chroma;
 int y0 = y >> chroma;
-int stride = s->frame->linesize[c_idx];
+ptrdiff_t stride = s->frame->linesize[c_idx];
 int ctb_size = (1 << (s->ps.sps->log2_ctb_size)) >> 
s->ps.sps->hshift[c_idx];
 int width = FFMIN(ctb_size,
   (s->ps.sps->width >> s->ps.sps->hshift[c_idx]) - x0);
diff --git a/libavcodec/hevcdsp_template.c b/libavcodec/hevcdsp_template.c
index 076b251..cd55571 100644
--- a/libavcodec/hevcdsp_template.c
+++ b/libavcodec/hevcdsp_template.c
@@ -396,7 +396,7 @@ static void FUNC(sao_edge_filter_0)(uint8_t *_dst, uint8_t 
*_src,
 if (sao_eo_class != SAO_EO_VERT) {
 if (borders[0]) {
 int offset_val = sao_offset_val[0];
-int y_stride   = 0;
+ptrdiff_t y_stride   = 0;
 for (y = 0; y < height; y++) {
 dst[y_stride] = av_clip_pixel(src[y_stride] + offset_val);
 y_stride += 

[FFmpeg-cvslog] Merge commit 'ba479f3daafc7e4359ec1212164569ebe59f0bb7'

2017-03-21 Thread James Almer
ffmpeg | branch: master | James Almer  | Tue Mar 21 15:49:09 
2017 -0300| [1e185488269fd5639bc4fe826c8cd53c3e45c047] | committer: James Almer

Merge commit 'ba479f3daafc7e4359ec1212164569ebe59f0bb7'

* commit 'ba479f3daafc7e4359ec1212164569ebe59f0bb7':
  hevc: Change type of array stride parameters to ptrdiff_t

Merged-by: James Almer 

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

 libavcodec/hevc.c | 12 ++--
 libavcodec/hevc_filter.c  | 10 +-
 libavcodec/hevcdsp_template.c |  8 
 3 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index 505249e..0b4a719 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -1283,11 +1283,11 @@ static int hls_pcm_sample(HEVCContext *s, int x0, int 
y0, int log2_cb_size)
 HEVCLocalContext *lc = s->HEVClc;
 GetBitContext gb;
 int cb_size   = 1 << log2_cb_size;
-int stride0   = s->frame->linesize[0];
+ptrdiff_t stride0 = s->frame->linesize[0];
+ptrdiff_t stride1 = s->frame->linesize[1];
+ptrdiff_t stride2 = s->frame->linesize[2];
 uint8_t *dst0 = >frame->data[0][y0 * stride0 + (x0 << 
s->ps.sps->pixel_shift)];
-int   stride1 = s->frame->linesize[1];
 uint8_t *dst1 = >frame->data[1][(y0 >> s->ps.sps->vshift[1]) * stride1 
+ ((x0 >> s->ps.sps->hshift[1]) << s->ps.sps->pixel_shift)];
-int   stride2 = s->frame->linesize[2];
 uint8_t *dst2 = >frame->data[2][(y0 >> s->ps.sps->vshift[2]) * stride2 
+ ((x0 >> s->ps.sps->hshift[2]) << s->ps.sps->pixel_shift)];
 
 int length = cb_size * cb_size * s->ps.sps->pcm.bit_depth +
@@ -1357,7 +1357,7 @@ static void luma_mc_uni(HEVCContext *s, uint8_t *dst, 
ptrdiff_t dststride,
 if (x_off < QPEL_EXTRA_BEFORE || y_off < QPEL_EXTRA_AFTER ||
 x_off >= pic_width - block_w - QPEL_EXTRA_AFTER ||
 y_off >= pic_height - block_h - QPEL_EXTRA_AFTER) {
-const int edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << 
s->ps.sps->pixel_shift;
+const ptrdiff_t edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << 
s->ps.sps->pixel_shift;
 int offset = QPEL_EXTRA_BEFORE * srcstride   + 
(QPEL_EXTRA_BEFORE << s->ps.sps->pixel_shift);
 int buf_offset = QPEL_EXTRA_BEFORE * edge_emu_stride + 
(QPEL_EXTRA_BEFORE << s->ps.sps->pixel_shift);
 
@@ -1423,7 +1423,7 @@ static void luma_mc_uni(HEVCContext *s, uint8_t *dst, 
ptrdiff_t dststride,
 if (x_off0 < QPEL_EXTRA_BEFORE || y_off0 < QPEL_EXTRA_AFTER ||
 x_off0 >= pic_width - block_w - QPEL_EXTRA_AFTER ||
 y_off0 >= pic_height - block_h - QPEL_EXTRA_AFTER) {
-const int edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << 
s->ps.sps->pixel_shift;
+const ptrdiff_t edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << 
s->ps.sps->pixel_shift;
 int offset = QPEL_EXTRA_BEFORE * src0stride   + 
(QPEL_EXTRA_BEFORE << s->ps.sps->pixel_shift);
 int buf_offset = QPEL_EXTRA_BEFORE * edge_emu_stride + 
(QPEL_EXTRA_BEFORE << s->ps.sps->pixel_shift);
 
@@ -1440,7 +1440,7 @@ static void luma_mc_uni(HEVCContext *s, uint8_t *dst, 
ptrdiff_t dststride,
 if (x_off1 < QPEL_EXTRA_BEFORE || y_off1 < QPEL_EXTRA_AFTER ||
 x_off1 >= pic_width - block_w - QPEL_EXTRA_AFTER ||
 y_off1 >= pic_height - block_h - QPEL_EXTRA_AFTER) {
-const int edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << 
s->ps.sps->pixel_shift;
+const ptrdiff_t edge_emu_stride = EDGE_EMU_BUFFER_STRIDE << 
s->ps.sps->pixel_shift;
 int offset = QPEL_EXTRA_BEFORE * src1stride   + 
(QPEL_EXTRA_BEFORE << s->ps.sps->pixel_shift);
 int buf_offset = QPEL_EXTRA_BEFORE * edge_emu_stride + 
(QPEL_EXTRA_BEFORE << s->ps.sps->pixel_shift);
 
diff --git a/libavcodec/hevc_filter.c b/libavcodec/hevc_filter.c
index 6918a55..fe520f4 100644
--- a/libavcodec/hevc_filter.c
+++ b/libavcodec/hevc_filter.c
@@ -139,7 +139,7 @@ static int get_qPy(HEVCContext *s, int xC, int yC)
 }
 
 static void copy_CTB(uint8_t *dst, const uint8_t *src, int width, int height,
- intptr_t stride_dst, intptr_t stride_src)
+ ptrdiff_t stride_dst, ptrdiff_t stride_src)
 {
 int i, j;
 
@@ -170,7 +170,7 @@ static void copy_pixel(uint8_t *dst, const uint8_t *src, 
int pixel_shift)
 
 static void copy_vert(uint8_t *dst, const uint8_t *src,
   int pixel_shift, int height,
-  int stride_dst, int stride_src)
+  ptrdiff_t stride_dst, ptrdiff_t stride_src)
 {
 int i;
 if (pixel_shift == 0) {
@@ -189,7 +189,7 @@ static void copy_vert(uint8_t *dst, const uint8_t *src,
 }
 
 static void copy_CTB_to_hv(HEVCContext *s, const uint8_t *src,
-   int stride_src, int x, int y, int width, int height,
+   ptrdiff_t stride_src, int x, int y, int width, int 
height,
int c_idx, int 

[FFmpeg-cvslog] h264chroma: Change type of stride parameters to ptrdiff_t

2017-03-21 Thread Diego Biurrun
ffmpeg | branch: master | Diego Biurrun  | Thu Sep  1 
21:41:01 2016 +0200| [e4a94d8b36c48d95a7d412c40d7b558422ff659c] | committer: 
Diego Biurrun

h264chroma: Change type of stride parameters to ptrdiff_t

This avoids SIMD-optimized functions having to sign-extend their
stride argument manually to be able to do pointer arithmetic.

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

 libavcodec/aarch64/h264chroma_init_aarch64.c | 12 ++--
 libavcodec/aarch64/h264cmc_neon.S|  7 ++-
 libavcodec/aarch64/rv40dsp_init_aarch64.c| 16 
 libavcodec/aarch64/vc1dsp_init_aarch64.c | 16 
 libavcodec/arm/h264chroma_init_arm.c | 18 --
 libavcodec/arm/h264cmc_neon.S|  4 ++--
 libavcodec/arm/vc1dsp_init_neon.c| 16 
 libavcodec/h264chroma.h  |  3 ++-
 libavcodec/h264chroma_template.c | 16 ++--
 libavcodec/ppc/h264chroma_template.c |  9 +++--
 libavcodec/rv40dsp.c | 14 ++
 libavcodec/vc1dsp.c  |  8 
 libavcodec/x86/h264_chromamc.asm | 18 +-
 libavcodec/x86/h264_chromamc_10bit.asm   | 15 ++-
 libavcodec/x86/h264chroma_init.c | 26 +-
 libavcodec/x86/rv40dsp_init.c| 12 ++--
 libavcodec/x86/vc1dsp_init.c | 10 +-
 17 files changed, 110 insertions(+), 110 deletions(-)

diff --git a/libavcodec/aarch64/h264chroma_init_aarch64.c 
b/libavcodec/aarch64/h264chroma_init_aarch64.c
index c7679ab..a373291 100644
--- a/libavcodec/aarch64/h264chroma_init_aarch64.c
+++ b/libavcodec/aarch64/h264chroma_init_aarch64.c
@@ -28,18 +28,18 @@
 
 #include "config.h"
 
-void ff_put_h264_chroma_mc8_neon(uint8_t *dst, uint8_t *src, int stride,
+void ff_put_h264_chroma_mc8_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
  int h, int x, int y);
-void ff_put_h264_chroma_mc4_neon(uint8_t *dst, uint8_t *src, int stride,
+void ff_put_h264_chroma_mc4_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
  int h, int x, int y);
-void ff_put_h264_chroma_mc2_neon(uint8_t *dst, uint8_t *src, int stride,
+void ff_put_h264_chroma_mc2_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
  int h, int x, int y);
 
-void ff_avg_h264_chroma_mc8_neon(uint8_t *dst, uint8_t *src, int stride,
+void ff_avg_h264_chroma_mc8_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
  int h, int x, int y);
-void ff_avg_h264_chroma_mc4_neon(uint8_t *dst, uint8_t *src, int stride,
+void ff_avg_h264_chroma_mc4_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
  int h, int x, int y);
-void ff_avg_h264_chroma_mc2_neon(uint8_t *dst, uint8_t *src, int stride,
+void ff_avg_h264_chroma_mc2_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
  int h, int x, int y);
 
 av_cold void ff_h264chroma_init_aarch64(H264ChromaContext *c, int bit_depth)
diff --git a/libavcodec/aarch64/h264cmc_neon.S 
b/libavcodec/aarch64/h264cmc_neon.S
index d1025c7..edc256c 100644
--- a/libavcodec/aarch64/h264cmc_neon.S
+++ b/libavcodec/aarch64/h264cmc_neon.S
@@ -21,10 +21,9 @@
 
 #include "libavutil/aarch64/asm.S"
 
-/* chroma_mc8(uint8_t *dst, uint8_t *src, int stride, int h, int x, int y) */
+/* chroma_mc8(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int h, int x, int 
y) */
 .macro  h264_chroma_mc8 type, codec=h264
 function ff_\type\()_\codec\()_chroma_mc8_neon, export=1
-sxtwx2,  w2
   .ifc \type,avg
 mov x8,  x0
   .endif
@@ -192,10 +191,9 @@ function ff_\type\()_\codec\()_chroma_mc8_neon, export=1
 endfunc
 .endm
 
-/* chroma_mc4(uint8_t *dst, uint8_t *src, int stride, int h, int x, int y) */
+/* chroma_mc4(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int h, int x, int 
y) */
 .macro  h264_chroma_mc4 type, codec=h264
 function ff_\type\()_\codec\()_chroma_mc4_neon, export=1
-sxtwx2,  w2
   .ifc \type,avg
 mov x8,  x0
   .endif
@@ -359,7 +357,6 @@ endfunc
 
 .macro  h264_chroma_mc2 type
 function ff_\type\()_h264_chroma_mc2_neon, export=1
-sxtwx2,  w2
 prfmpldl1strm, [x1]
 prfmpldl1strm, [x1, x2]
 orr w7,  w4,  w5
diff --git a/libavcodec/aarch64/rv40dsp_init_aarch64.c 
b/libavcodec/aarch64/rv40dsp_init_aarch64.c
index 0bb404f..f7fcd5b 100644
--- a/libavcodec/aarch64/rv40dsp_init_aarch64.c
+++ b/libavcodec/aarch64/rv40dsp_init_aarch64.c
@@ -25,15 +25,15 @@
 
 #include "config.h"
 
-void ff_put_rv40_chroma_mc8_neon(uint8_t *dst, uint8_t *src, int stride, int h,
- int x, int y);
-void 

[FFmpeg-cvslog] idct: Change type of array stride parameters to ptrdiff_t

2017-03-21 Thread Diego Biurrun
ffmpeg | branch: master | Diego Biurrun  | Wed Sep  7 
17:02:06 2016 +0200| [2ec9fa5ec60dcd10e1cb10d8b4e4437e634ea428] | committer: 
Diego Biurrun

idct: Change type of array stride parameters to ptrdiff_t

ptrdiff_t is the correct type for array strides and similar.

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

 doc/optimization.txt|  2 +-
 libavcodec/arm/idct.h   | 13 
 libavcodec/arm/idctdsp_arm.S|  2 +-
 libavcodec/arm/idctdsp_init_arm.c   | 15 ++
 libavcodec/arm/idctdsp_init_armv6.c |  2 +-
 libavcodec/arm/simple_idct_armv6.S  |  4 +--
 libavcodec/arm/simple_idct_neon.S   |  4 +--
 libavcodec/arm/vc1dsp_init_neon.c   | 14 -
 libavcodec/arm/vc1dsp_neon.S|  6 ++--
 libavcodec/dct.h|  5 ++--
 libavcodec/dv.h |  2 +-
 libavcodec/dvdec.c  |  2 +-
 libavcodec/faanidct.c   | 10 +--
 libavcodec/faanidct.h   |  5 ++--
 libavcodec/idctdsp.c| 10 +++
 libavcodec/idctdsp.h| 14 -
 libavcodec/jrevdct.c|  4 +--
 libavcodec/ppc/idctdsp.c|  4 +--
 libavcodec/ppc/vc1dsp_altivec.c |  3 +-
 libavcodec/simple_idct.c| 12 
 libavcodec/simple_idct.h| 17 ++-
 libavcodec/simple_idct_template.c   |  8 ++---
 libavcodec/tests/dct.c  |  5 ++--
 libavcodec/vc1dsp.c | 54 -
 libavcodec/vc1dsp.h | 14 -
 libavcodec/wmv2dsp.c|  4 +--
 libavcodec/wmv2dsp.h|  4 +--
 libavcodec/x86/idctdsp.h|  7 +++--
 libavcodec/x86/idctdsp_mmx.c|  6 ++--
 libavcodec/x86/simple_idct.c|  4 +--
 libavcodec/x86/simple_idct.h|  5 ++--
 libavcodec/x86/vc1dsp_mmx.c | 60 ++---
 libavcodec/x86/xvididct.h   | 13 
 libavcodec/x86/xvididct_mmx.c   |  8 ++---
 libavcodec/x86/xvididct_sse2.c  |  4 +--
 libavcodec/xvididct.c   |  4 +--
 36 files changed, 184 insertions(+), 166 deletions(-)

diff --git a/doc/optimization.txt b/doc/optimization.txt
index 9847dcf..be12d85 100644
--- a/doc/optimization.txt
+++ b/doc/optimization.txt
@@ -142,7 +142,7 @@ Alignment:
 Some instructions on some architectures have strict alignment restrictions,
 for example most SSE/SSE2 instructions on x86.
 The minimum guaranteed alignment is written in the .h files, for example:
-void (*put_pixels_clamped)(const int16_t *block/*align 16*/, UINT8 
*pixels/*align 8*/, int line_size);
+void (*put_pixels_clamped)(const int16_t *block/*align 16*/, uint8_t 
*pixels/*align 8*/, ptrdiff_t stride);
 
 
 General Tips:
diff --git a/libavcodec/arm/idct.h b/libavcodec/arm/idct.h
index 168d64b..db4d6c5 100644
--- a/libavcodec/arm/idct.h
+++ b/libavcodec/arm/idct.h
@@ -19,6 +19,7 @@
 #ifndef AVCODEC_ARM_IDCT_H
 #define AVCODEC_ARM_IDCT_H
 
+#include 
 #include 
 
 void ff_j_rev_dct_arm(int16_t *data);
@@ -26,15 +27,15 @@ void ff_j_rev_dct_arm(int16_t *data);
 void ff_simple_idct_arm(int16_t *data);
 
 void ff_simple_idct_armv5te(int16_t *data);
-void ff_simple_idct_put_armv5te(uint8_t *dest, int line_size, int16_t *data);
-void ff_simple_idct_add_armv5te(uint8_t *dest, int line_size, int16_t *data);
+void ff_simple_idct_put_armv5te(uint8_t *dest, ptrdiff_t line_size, int16_t 
*data);
+void ff_simple_idct_add_armv5te(uint8_t *dest, ptrdiff_t line_size, int16_t 
*data);
 
 void ff_simple_idct_armv6(int16_t *data);
-void ff_simple_idct_put_armv6(uint8_t *dest, int line_size, int16_t *data);
-void ff_simple_idct_add_armv6(uint8_t *dest, int line_size, int16_t *data);
+void ff_simple_idct_put_armv6(uint8_t *dest, ptrdiff_t line_size, int16_t 
*data);
+void ff_simple_idct_add_armv6(uint8_t *dest, ptrdiff_t line_size, int16_t 
*data);
 
 void ff_simple_idct_neon(int16_t *data);
-void ff_simple_idct_put_neon(uint8_t *dest, int line_size, int16_t *data);
-void ff_simple_idct_add_neon(uint8_t *dest, int line_size, int16_t *data);
+void ff_simple_idct_put_neon(uint8_t *dest, ptrdiff_t line_size, int16_t 
*data);
+void ff_simple_idct_add_neon(uint8_t *dest, ptrdiff_t line_size, int16_t 
*data);
 
 #endif /* AVCODEC_ARM_IDCT_H */
diff --git a/libavcodec/arm/idctdsp_arm.S b/libavcodec/arm/idctdsp_arm.S
index 34f467e..0d6a76b 100644
--- a/libavcodec/arm/idctdsp_arm.S
+++ b/libavcodec/arm/idctdsp_arm.S
@@ -22,7 +22,7 @@
 #include "config.h"
 #include "libavutil/arm/asm.S"
 
-@ void ff_add_pixels_clamped_arm(int16_t *block, uint8_t *dest, int stride)
+@ void ff_add_pixels_clamped_arm(int16_t *block, uint8_t *dest, ptrdiff_t 
stride)
 function ff_add_pixels_clamped_arm, export=1, align=5
 push{r4-r10}
 mov r10, #8
diff --git a/libavcodec/arm/idctdsp_init_arm.c 
b/libavcodec/arm/idctdsp_init_arm.c
index 

[FFmpeg-cvslog] aacsbr: Turnoff in the event of over read.

2017-03-21 Thread Alex Converse
ffmpeg | branch: master | Alex Converse  | Mon Mar 20 
12:44:42 2017 -0700| [2c8a3aa985acc906ecab37357f2798da7cb9822d] | committer: 
Alex Converse

aacsbr: Turnoff in the event of over read.

Aliased compressed AAC bytes are almost certainly not meaningful SBR
data. In the wild this causes harsh artifacts switching HE-AAC streams
that don't have SBR headers aligned with segment boundaries.

Turning off SBR falls back to a default set of upsampling parameters
that can function as a sort of error concealment. This is consistent
with how the decoder handles other sorts of errors.

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

 libavcodec/aacsbr_template.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/aacsbr_template.c b/libavcodec/aacsbr_template.c
index cf8621e..750131c 100644
--- a/libavcodec/aacsbr_template.c
+++ b/libavcodec/aacsbr_template.c
@@ -1137,6 +1137,7 @@ int AAC_RENAME(ff_decode_sbr_extension)(AACContext *ac, 
SpectralBandReplication
 if (bytes_read > cnt) {
 av_log(ac->avctx, AV_LOG_ERROR,
"Expected to read %d SBR bytes actually read %d.\n", cnt, 
bytes_read);
+sbr_turnoff(sbr);
 }
 return cnt;
 }

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


[FFmpeg-cvslog] swresample/resample: move resample_free() higher in the file

2017-03-21 Thread James Almer
ffmpeg | branch: release/3.0 | James Almer  | Tue Mar 21 
12:02:35 2017 -0300| [2423dd965637e1baecd9ad0ec3ecaf9ca59ff66e] | committer: 
James Almer

swresample/resample: move resample_free() higher in the file

Also make it more readable while at it.

Signed-off-by: James Almer 
(cherry picked from commit 2a8a8a2e98136c22f6e07ff669251afb8a033676)

Conflicts:
libswresample/resample.c

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

 libswresample/resample.c | 15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/libswresample/resample.c b/libswresample/resample.c
index d410432..a0c2a3a 100644
--- a/libswresample/resample.c
+++ b/libswresample/resample.c
@@ -295,6 +295,14 @@ fail:
 return 0;
 }
 
+static void resample_free(ResampleContext **cc){
+ResampleContext *c = *cc;
+if(!c)
+return;
+av_freep(>filter_bank);
+av_freep(cc);
+}
+
 static ResampleContext *resample_init(ResampleContext *c, int out_rate, int 
in_rate, int filter_size, int phase_shift, int linear,
 double cutoff0, enum AVSampleFormat 
format, enum SwrFilterType filter_type, double kaiser_beta,
 double precision, int cheby)
@@ -375,13 +383,6 @@ error:
 return NULL;
 }
 
-static void resample_free(ResampleContext **c){
-if(!*c)
-return;
-av_freep(&(*c)->filter_bank);
-av_freep(c);
-}
-
 static int set_compensation(ResampleContext *c, int sample_delta, int 
compensation_distance){
 c->compensation_distance= compensation_distance;
 if (compensation_distance)

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


[FFmpeg-cvslog] swresample/resample: free existing ResampleContext on reinit

2017-03-21 Thread James Almer
ffmpeg | branch: release/2.8 | James Almer  | Tue Mar 21 
12:03:44 2017 -0300| [31e65eb84d6d1cce2feea1147650a78dc56936c4] | committer: 
James Almer

swresample/resample: free existing ResampleContext on reinit

Fixes memleak.

Reviewed-by: wm4 
Reviewed-by: Michael Niedermayer 
Signed-off-by: James Almer 
(cherry picked from commit db7a05dab0652d4ec6d89394c9024d02f44494a7)

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

 libswresample/resample.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libswresample/resample.c b/libswresample/resample.c
index 97bf9c4..02301ff 100644
--- a/libswresample/resample.c
+++ b/libswresample/resample.c
@@ -190,6 +190,7 @@ static ResampleContext *resample_init(ResampleContext *c, 
int out_rate, int in_r
 if (!c || c->phase_shift != phase_shift || c->linear!=linear || c->factor 
!= factor
|| c->filter_length != FFMAX((int)ceil(filter_size/factor), 1) || 
c->format != format
|| c->filter_type != filter_type || c->kaiser_beta != kaiser_beta) {
+resample_free();
 c = av_mallocz(sizeof(*c));
 if (!c)
 return NULL;

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


[FFmpeg-cvslog] swresample/resample: move resample_free() higher in the file

2017-03-21 Thread James Almer
ffmpeg | branch: release/3.1 | James Almer  | Tue Mar 21 
12:02:35 2017 -0300| [f9083dec0c2ef79ab44d7511f86bd0bf7fe45978] | committer: 
James Almer

swresample/resample: move resample_free() higher in the file

Also make it more readable while at it.

Signed-off-by: James Almer 
(cherry picked from commit 2a8a8a2e98136c22f6e07ff669251afb8a033676)

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

 libswresample/resample.c | 15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/libswresample/resample.c b/libswresample/resample.c
index b834248..2e161b1 100644
--- a/libswresample/resample.c
+++ b/libswresample/resample.c
@@ -298,6 +298,14 @@ fail:
 return 0;
 }
 
+static void resample_free(ResampleContext **cc){
+ResampleContext *c = *cc;
+if(!c)
+return;
+av_freep(>filter_bank);
+av_freep(cc);
+}
+
 static ResampleContext *resample_init(ResampleContext *c, int out_rate, int 
in_rate, int filter_size, int phase_shift, int linear,
 double cutoff0, enum AVSampleFormat 
format, enum SwrFilterType filter_type, double kaiser_beta,
 double precision, int cheby, int 
exact_rational)
@@ -389,13 +397,6 @@ error:
 return NULL;
 }
 
-static void resample_free(ResampleContext **c){
-if(!*c)
-return;
-av_freep(&(*c)->filter_bank);
-av_freep(c);
-}
-
 static int rebuild_filter_bank_with_compensation(ResampleContext *c)
 {
 uint8_t *new_filter_bank;

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


[FFmpeg-cvslog] swresample/resample: free existing ResampleContext on reinit

2017-03-21 Thread James Almer
ffmpeg | branch: release/3.1 | James Almer  | Tue Mar 21 
12:03:44 2017 -0300| [8e4abfbb9dbc6ff192926e4d6befef40897a5479] | committer: 
James Almer

swresample/resample: free existing ResampleContext on reinit

Fixes memleak.

Reviewed-by: wm4 
Reviewed-by: Michael Niedermayer 
Signed-off-by: James Almer 
(cherry picked from commit db7a05dab0652d4ec6d89394c9024d02f44494a7)

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

 libswresample/resample.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libswresample/resample.c b/libswresample/resample.c
index 2e161b1..e7c9e73 100644
--- a/libswresample/resample.c
+++ b/libswresample/resample.c
@@ -328,6 +328,7 @@ static ResampleContext *resample_init(ResampleContext *c, 
int out_rate, int in_r
 if (!c || c->phase_count != phase_count || c->linear!=linear || c->factor 
!= factor
|| c->filter_length != FFMAX((int)ceil(filter_size/factor), 1) || 
c->format != format
|| c->filter_type != filter_type || c->kaiser_beta != kaiser_beta) {
+resample_free();
 c = av_mallocz(sizeof(*c));
 if (!c)
 return NULL;

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


[FFmpeg-cvslog] swresample/resample: move resample_free() higher in the file

2017-03-21 Thread James Almer
ffmpeg | branch: release/3.2 | James Almer  | Tue Mar 21 
12:02:35 2017 -0300| [2d322bf3e9d9c7713bd888517d7348faf1c31622] | committer: 
James Almer

swresample/resample: move resample_free() higher in the file

Also make it more readable while at it.

Signed-off-by: James Almer 
(cherry picked from commit 2a8a8a2e98136c22f6e07ff669251afb8a033676)

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

 libswresample/resample.c | 15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/libswresample/resample.c b/libswresample/resample.c
index 8635bf1..c9b112d 100644
--- a/libswresample/resample.c
+++ b/libswresample/resample.c
@@ -300,6 +300,14 @@ fail:
 return ret;
 }
 
+static void resample_free(ResampleContext **cc){
+ResampleContext *c = *cc;
+if(!c)
+return;
+av_freep(>filter_bank);
+av_freep(cc);
+}
+
 static ResampleContext *resample_init(ResampleContext *c, int out_rate, int 
in_rate, int filter_size, int phase_shift, int linear,
 double cutoff0, enum AVSampleFormat 
format, enum SwrFilterType filter_type, double kaiser_beta,
 double precision, int cheby, int 
exact_rational)
@@ -391,13 +399,6 @@ error:
 return NULL;
 }
 
-static void resample_free(ResampleContext **c){
-if(!*c)
-return;
-av_freep(&(*c)->filter_bank);
-av_freep(c);
-}
-
 static int rebuild_filter_bank_with_compensation(ResampleContext *c)
 {
 uint8_t *new_filter_bank;

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


[FFmpeg-cvslog] swresample/resample: free existing ResampleContext on reinit

2017-03-21 Thread James Almer
ffmpeg | branch: release/3.2 | James Almer  | Tue Mar 21 
12:03:44 2017 -0300| [2bf28b9db6e7c3137d73dfc60139e4d62b010145] | committer: 
James Almer

swresample/resample: free existing ResampleContext on reinit

Fixes memleak.

Reviewed-by: wm4 
Reviewed-by: Michael Niedermayer 
Signed-off-by: James Almer 
(cherry picked from commit db7a05dab0652d4ec6d89394c9024d02f44494a7)

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

 libswresample/resample.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libswresample/resample.c b/libswresample/resample.c
index c9b112d..46e5a26 100644
--- a/libswresample/resample.c
+++ b/libswresample/resample.c
@@ -330,6 +330,7 @@ static ResampleContext *resample_init(ResampleContext *c, 
int out_rate, int in_r
 if (!c || c->phase_count != phase_count || c->linear!=linear || c->factor 
!= factor
|| c->filter_length != FFMAX((int)ceil(filter_size/factor), 1) || 
c->format != format
|| c->filter_type != filter_type || c->kaiser_beta != kaiser_beta) {
+resample_free();
 c = av_mallocz(sizeof(*c));
 if (!c)
 return NULL;

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


[FFmpeg-cvslog] swresample/resample: free existing ResampleContext on reinit

2017-03-21 Thread James Almer
ffmpeg | branch: release/3.0 | James Almer  | Tue Mar 21 
12:03:44 2017 -0300| [4c97b79cf560afe6a9ddfef9843fff3489d08ce7] | committer: 
James Almer

swresample/resample: free existing ResampleContext on reinit

Fixes memleak.

Reviewed-by: wm4 
Reviewed-by: Michael Niedermayer 
Signed-off-by: James Almer 
(cherry picked from commit db7a05dab0652d4ec6d89394c9024d02f44494a7)

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

 libswresample/resample.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libswresample/resample.c b/libswresample/resample.c
index a0c2a3a..a19af17 100644
--- a/libswresample/resample.c
+++ b/libswresample/resample.c
@@ -314,6 +314,7 @@ static ResampleContext *resample_init(ResampleContext *c, 
int out_rate, int in_r
 if (!c || c->phase_shift != phase_shift || c->linear!=linear || c->factor 
!= factor
|| c->filter_length != FFMAX((int)ceil(filter_size/factor), 1) || 
c->format != format
|| c->filter_type != filter_type || c->kaiser_beta != kaiser_beta) {
+resample_free();
 c = av_mallocz(sizeof(*c));
 if (!c)
 return NULL;

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


[FFmpeg-cvslog] swresample/resample: move resample_free() higher in the file

2017-03-21 Thread James Almer
ffmpeg | branch: release/2.8 | James Almer  | Tue Mar 21 
12:02:35 2017 -0300| [f7f5a524590bf3da35d3f84eefbf08cf7795468b] | committer: 
James Almer

swresample/resample: move resample_free() higher in the file

Also make it more readable while at it.

Signed-off-by: James Almer 
(cherry picked from commit 2a8a8a2e98136c22f6e07ff669251afb8a033676)

Conflicts:
libswresample/resample.c

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

 libswresample/resample.c | 15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/libswresample/resample.c b/libswresample/resample.c
index 8f3eb41..97bf9c4 100644
--- a/libswresample/resample.c
+++ b/libswresample/resample.c
@@ -171,6 +171,14 @@ static int build_filter(ResampleContext *c, void *filter, 
double factor, int tap
 return 0;
 }
 
+static void resample_free(ResampleContext **cc){
+ResampleContext *c = *cc;
+if(!c)
+return;
+av_freep(>filter_bank);
+av_freep(cc);
+}
+
 static ResampleContext *resample_init(ResampleContext *c, int out_rate, int 
in_rate, int filter_size, int phase_shift, int linear,
 double cutoff0, enum AVSampleFormat 
format, enum SwrFilterType filter_type, int kaiser_beta,
 double precision, int cheby)
@@ -251,13 +259,6 @@ error:
 return NULL;
 }
 
-static void resample_free(ResampleContext **c){
-if(!*c)
-return;
-av_freep(&(*c)->filter_bank);
-av_freep(c);
-}
-
 static int set_compensation(ResampleContext *c, int sample_delta, int 
compensation_distance){
 c->compensation_distance= compensation_distance;
 if (compensation_distance)

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


[FFmpeg-cvslog] swresample/resample: move resample_free() higher in the file

2017-03-21 Thread James Almer
ffmpeg | branch: master | James Almer  | Tue Mar 21 12:02:35 
2017 -0300| [2a8a8a2e98136c22f6e07ff669251afb8a033676] | committer: James Almer

swresample/resample: move resample_free() higher in the file

Also make it more readable while at it.

Signed-off-by: James Almer 

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

 libswresample/resample.c | 15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/libswresample/resample.c b/libswresample/resample.c
index 144b232..7b433d0 100644
--- a/libswresample/resample.c
+++ b/libswresample/resample.c
@@ -276,6 +276,14 @@ fail:
 return ret;
 }
 
+static void resample_free(ResampleContext **cc){
+ResampleContext *c = *cc;
+if(!c)
+return;
+av_freep(>filter_bank);
+av_freep(cc);
+}
+
 static ResampleContext *resample_init(ResampleContext *c, int out_rate, int 
in_rate, int filter_size, int phase_shift, int linear,
 double cutoff0, enum AVSampleFormat 
format, enum SwrFilterType filter_type, double kaiser_beta,
 double precision, int cheby, int 
exact_rational)
@@ -371,13 +379,6 @@ error:
 return NULL;
 }
 
-static void resample_free(ResampleContext **c){
-if(!*c)
-return;
-av_freep(&(*c)->filter_bank);
-av_freep(c);
-}
-
 static int rebuild_filter_bank_with_compensation(ResampleContext *c)
 {
 uint8_t *new_filter_bank;

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


[FFmpeg-cvslog] swresample/resample: free existing ResampleContext on reinit

2017-03-21 Thread James Almer
ffmpeg | branch: master | James Almer  | Tue Mar 21 12:03:44 
2017 -0300| [db7a05dab0652d4ec6d89394c9024d02f44494a7] | committer: James Almer

swresample/resample: free existing ResampleContext on reinit

Fixes memleak.

Reviewed-by: wm4 
Reviewed-by: Michael Niedermayer 
Signed-off-by: James Almer 

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

 libswresample/resample.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libswresample/resample.c b/libswresample/resample.c
index 7b433d0..39c242b 100644
--- a/libswresample/resample.c
+++ b/libswresample/resample.c
@@ -310,6 +310,7 @@ static ResampleContext *resample_init(ResampleContext *c, 
int out_rate, int in_r
 if (!c || c->phase_count != phase_count || c->linear!=linear || c->factor 
!= factor
|| c->filter_length != filter_length || c->format != format
|| c->filter_type != filter_type || c->kaiser_beta != kaiser_beta) {
+resample_free();
 c = av_mallocz(sizeof(*c));
 if (!c)
 return NULL;

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


[FFmpeg-cvslog] intrax8: Change type of array stride parameters to ptrdiff_t

2017-03-21 Thread Diego Biurrun
ffmpeg | branch: master | Diego Biurrun  | Thu Sep  8 
15:08:03 2016 +0200| [3281d823cdc7601c4900eb103958c05f59f6] | committer: 
Diego Biurrun

intrax8: Change type of array stride parameters to ptrdiff_t

ptrdiff_t is the correct type for array strides and similar.

Also rename all such parameters to "stride" for consistency.

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

 libavcodec/intrax8.c|  8 +++---
 libavcodec/intrax8dsp.c | 67 +
 libavcodec/intrax8dsp.h | 13 ++
 3 files changed, 46 insertions(+), 42 deletions(-)

diff --git a/libavcodec/intrax8.c b/libavcodec/intrax8.c
index eb4c1ef..9c20c8f 100644
--- a/libavcodec/intrax8.c
+++ b/libavcodec/intrax8.c
@@ -548,7 +548,7 @@ static void x8_ac_compensation(IntraX8Context *const w, 
const int direction,
 }
 
 static void dsp_x8_put_solidcolor(const uint8_t pix, uint8_t *dst,
-  const int linesize)
+  const ptrdiff_t linesize)
 {
 int k;
 for (k = 0; k < 8; k++) {
@@ -700,7 +700,7 @@ block_placed:
 
 if (w->loopfilter) {
 uint8_t *ptr = w->dest[chroma];
-int linesize = w->frame->linesize[!!chroma];
+ptrdiff_t linesize = w->frame->linesize[!!chroma];
 
 if (!((w->edges & 2) || (zeros_only && (w->orient | 4) == 4)))
 w->dsp.h_loop_filter(ptr, linesize, w->quant);
@@ -716,8 +716,8 @@ static void x8_init_block_index(IntraX8Context *w, AVFrame 
*frame)
 {
 // not parent codec linesize as this would be wrong for field pics
 // not that IntraX8 has interlacing support ;)
-const int linesize   = frame->linesize[0];
-const int uvlinesize = frame->linesize[1];
+const ptrdiff_t linesize   = frame->linesize[0];
+const ptrdiff_t uvlinesize = frame->linesize[1];
 
 w->dest[0] = frame->data[0];
 w->dest[1] = frame->data[1];
diff --git a/libavcodec/intrax8dsp.c b/libavcodec/intrax8dsp.c
index 108cfe3..bb74a68 100644
--- a/libavcodec/intrax8dsp.c
+++ b/libavcodec/intrax8dsp.c
@@ -63,8 +63,8 @@
 4   - mb_x>= (mb_width-1) last block in the row, interpolate 
area #5;
 -*/
 static void x8_setup_spatial_compensation(uint8_t *src, uint8_t *dst,
-  int linesize, int *range, int *psum,
-  int edges)
+  ptrdiff_t stride, int *range,
+  int *psum, int edges)
 {
 uint8_t *ptr;
 int sum;
@@ -98,12 +98,12 @@ static void x8_setup_spatial_compensation(uint8_t *src, 
uint8_t *dst,
 max_pix= FFMAX(max_pix, c);
 dst[area2 + i] = c;
 
-ptr += linesize;
+ptr += stride;
 }
 }
 
 if (!(edges & 2)) { // (mb_y != 0) // there is row above
-ptr = src - linesize; // top line
+ptr = src - stride; // top line
 for (i = 0; i < 8; i++) {
 c   = *(ptr + i);
 sum+= c;
@@ -117,7 +117,7 @@ static void x8_setup_spatial_compensation(uint8_t *src, 
uint8_t *dst,
 memcpy(dst + area4, ptr, 16); // both area4 and 5
 }
 // area6 always present in the above block
-memcpy(dst + area6, ptr - linesize, 8);
+memcpy(dst + area6, ptr - stride, 8);
 }
 // now calculate the stuff we need
 if (edges & 3) { // mb_x ==0 || mb_y == 0) {
@@ -131,7 +131,7 @@ static void x8_setup_spatial_compensation(uint8_t *src, 
uint8_t *dst,
 sum += avg * 9;
 } else {
 // the edge pixel, in the top line and left column
-uint8_t c = *(src - 1 - linesize);
+uint8_t c = *(src - 1 - stride);
 dst[area3] = c;
 sum   += c;
 // edge pixel is not part of min/max
@@ -160,7 +160,7 @@ static const uint16_t zero_prediction_weights[64 * 2] = {
 317,  846, 366,  731, 458,  611, 499, 499,
 };
 
-static void spatial_compensation_0(uint8_t *src, uint8_t *dst, int linesize)
+static void spatial_compensation_0(uint8_t *src, uint8_t *dst, ptrdiff_t 
stride)
 {
 int i, j;
 int x, y;
@@ -208,55 +208,55 @@ static void spatial_compensation_0(uint8_t *src, uint8_t 
*dst, int linesize)
 dst[x] = ((uint32_t)  top_sum[0][x] * zero_prediction_weights[y * 
16 + x * 2 + 0] +
   (uint32_t) left_sum[0][y] * zero_prediction_weights[y * 
16 + x * 2 + 1] +
   0x8000) >> 16;
-dst += linesize;
+dst += stride;
 }
 }
 
-static void spatial_compensation_1(uint8_t *src, uint8_t *dst, int linesize)
+static void spatial_compensation_1(uint8_t *src, uint8_t *dst, ptrdiff_t 
stride)
 {
 int x, y;
 
 for (y = 0; y < 8; y++) {
 for (x = 0; x < 8; x++)
 dst[x] = src[area4 + FFMIN(2 * y + x + 2, 15)];
-dst += linesize;
+dst += stride;
 }
 }
 

[FFmpeg-cvslog] Merge commit '3281d823cdc7601c4900eb103958c05f59f65555'

2017-03-21 Thread Clément Bœsch
ffmpeg | branch: master | Clément Bœsch  | Tue Mar 21 15:13:36 
2017 +0100| [6eb75e7d592d103618f8b3fa1d9385abadbef156] | committer: Clément 
Bœsch

Merge commit '3281d823cdc7601c4900eb103958c05f59f6'

* commit '3281d823cdc7601c4900eb103958c05f59f6':
  intrax8: Change type of array stride parameters to ptrdiff_t

Merged-by: Clément Bœsch 

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

 libavcodec/intrax8.c|  8 +++---
 libavcodec/intrax8dsp.c | 67 +
 libavcodec/intrax8dsp.h | 13 ++
 3 files changed, 46 insertions(+), 42 deletions(-)

diff --git a/libavcodec/intrax8.c b/libavcodec/intrax8.c
index 5e1233b..bbb97f0 100644
--- a/libavcodec/intrax8.c
+++ b/libavcodec/intrax8.c
@@ -544,7 +544,7 @@ static void x8_ac_compensation(IntraX8Context *const w, 
const int direction,
 }
 
 static void dsp_x8_put_solidcolor(const uint8_t pix, uint8_t *dst,
-  const int linesize)
+  const ptrdiff_t linesize)
 {
 int k;
 for (k = 0; k < 8; k++) {
@@ -696,7 +696,7 @@ block_placed:
 
 if (w->loopfilter) {
 uint8_t *ptr = w->dest[chroma];
-int linesize = w->frame->linesize[!!chroma];
+ptrdiff_t linesize = w->frame->linesize[!!chroma];
 
 if (!((w->edges & 2) || (zeros_only && (w->orient | 4) == 4)))
 w->dsp.h_loop_filter(ptr, linesize, w->quant);
@@ -712,8 +712,8 @@ static void x8_init_block_index(IntraX8Context *w, AVFrame 
*frame)
 {
 // not parent codec linesize as this would be wrong for field pics
 // not that IntraX8 has interlacing support ;)
-const int linesize   = frame->linesize[0];
-const int uvlinesize = frame->linesize[1];
+const ptrdiff_t linesize   = frame->linesize[0];
+const ptrdiff_t uvlinesize = frame->linesize[1];
 
 w->dest[0] = frame->data[0];
 w->dest[1] = frame->data[1];
diff --git a/libavcodec/intrax8dsp.c b/libavcodec/intrax8dsp.c
index 5520e3c..80c3929 100644
--- a/libavcodec/intrax8dsp.c
+++ b/libavcodec/intrax8dsp.c
@@ -63,8 +63,8 @@
 4   - mb_x>= (mb_width-1) last block in the row, interpolate 
area #5;
 -*/
 static void x8_setup_spatial_compensation(uint8_t *src, uint8_t *dst,
-  int linesize, int *range, int *psum,
-  int edges)
+  ptrdiff_t stride, int *range,
+  int *psum, int edges)
 {
 uint8_t *ptr;
 int sum;
@@ -98,12 +98,12 @@ static void x8_setup_spatial_compensation(uint8_t *src, 
uint8_t *dst,
 max_pix= FFMAX(max_pix, c);
 dst[area2 + i] = c;
 
-ptr += linesize;
+ptr += stride;
 }
 }
 
 if (!(edges & 2)) { // (mb_y != 0) // there is row above
-ptr = src - linesize; // top line
+ptr = src - stride; // top line
 for (i = 0; i < 8; i++) {
 c   = *(ptr + i);
 sum+= c;
@@ -117,7 +117,7 @@ static void x8_setup_spatial_compensation(uint8_t *src, 
uint8_t *dst,
 memcpy(dst + area4, ptr, 16); // both area4 and 5
 }
 // area6 always present in the above block
-memcpy(dst + area6, ptr - linesize, 8);
+memcpy(dst + area6, ptr - stride, 8);
 }
 // now calculate the stuff we need
 if (edges & 3) { // mb_x ==0 || mb_y == 0) {
@@ -131,7 +131,7 @@ static void x8_setup_spatial_compensation(uint8_t *src, 
uint8_t *dst,
 sum += avg * 9;
 } else {
 // the edge pixel, in the top line and left column
-uint8_t c = *(src - 1 - linesize);
+uint8_t c = *(src - 1 - stride);
 dst[area3] = c;
 sum   += c;
 // edge pixel is not part of min/max
@@ -160,7 +160,7 @@ static const uint16_t zero_prediction_weights[64 * 2] = {
 317,  846, 366,  731, 458,  611, 499, 499,
 };
 
-static void spatial_compensation_0(uint8_t *src, uint8_t *dst, int linesize)
+static void spatial_compensation_0(uint8_t *src, uint8_t *dst, ptrdiff_t 
stride)
 {
 int i, j;
 int x, y;
@@ -208,55 +208,55 @@ static void spatial_compensation_0(uint8_t *src, uint8_t 
*dst, int linesize)
 dst[x] = ((uint32_t)  top_sum[0][x] * zero_prediction_weights[y * 
16 + x * 2 + 0] +
   (uint32_t) left_sum[0][y] * zero_prediction_weights[y * 
16 + x * 2 + 1] +
   0x8000) >> 16;
-dst += linesize;
+dst += stride;
 }
 }
 
-static void spatial_compensation_1(uint8_t *src, uint8_t *dst, int linesize)
+static void spatial_compensation_1(uint8_t *src, uint8_t *dst, ptrdiff_t 
stride)
 {
 int x, y;
 
 for (y = 0; y < 8; y++) {
 for (x = 0; x < 8; x++)
 dst[x] = src[area4 + FFMIN(2 * y + x + 2, 15)];
-dst += linesize;
+dst += 

[FFmpeg-cvslog] blockdsp: Change type of array stride parameters to ptrdiff_t

2017-03-21 Thread Diego Biurrun
ffmpeg | branch: master | Diego Biurrun  | Thu Sep  8 
15:13:04 2016 +0200| [b2939a75270bc7e971462648168aa3a2a48c1c8c] | committer: 
Diego Biurrun

blockdsp: Change type of array stride parameters to ptrdiff_t

ptrdiff_t is the correct type for array strides and similar.

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

 libavcodec/blockdsp.c | 6 --
 libavcodec/blockdsp.h | 3 ++-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/libavcodec/blockdsp.c b/libavcodec/blockdsp.c
index a35df8c..2c396f1 100644
--- a/libavcodec/blockdsp.c
+++ b/libavcodec/blockdsp.c
@@ -35,7 +35,8 @@ static void clear_blocks_8_c(int16_t *blocks)
 memset(blocks, 0, sizeof(int16_t) * 6 * 64);
 }
 
-static void fill_block16_c(uint8_t *block, uint8_t value, int line_size, int h)
+static void fill_block16_c(uint8_t *block, uint8_t value, ptrdiff_t line_size,
+   int h)
 {
 int i;
 
@@ -45,7 +46,8 @@ static void fill_block16_c(uint8_t *block, uint8_t value, int 
line_size, int h)
 }
 }
 
-static void fill_block8_c(uint8_t *block, uint8_t value, int line_size, int h)
+static void fill_block8_c(uint8_t *block, uint8_t value, ptrdiff_t line_size,
+  int h)
 {
 int i;
 
diff --git a/libavcodec/blockdsp.h b/libavcodec/blockdsp.h
index 5b5639f..e555d29 100644
--- a/libavcodec/blockdsp.h
+++ b/libavcodec/blockdsp.h
@@ -19,6 +19,7 @@
 #ifndef AVCODEC_BLOCKDSP_H
 #define AVCODEC_BLOCKDSP_H
 
+#include 
 #include 
 
 #include "avcodec.h"
@@ -29,7 +30,7 @@
  * h for op_pixels_func is limited to { width / 2, width },
  * but never larger than 16 and never smaller than 4. */
 typedef void (*op_fill_func)(uint8_t *block /* align width (8 or 16) */,
- uint8_t value, int line_size, int h);
+ uint8_t value, ptrdiff_t line_size, int h);
 
 typedef struct BlockDSPContext {
 void (*clear_block)(int16_t *block /* align 16 */);

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


[FFmpeg-cvslog] Merge commit 'b2939a75270bc7e971462648168aa3a2a48c1c8c'

2017-03-21 Thread Clément Bœsch
ffmpeg | branch: master | Clément Bœsch  | Tue Mar 21 15:19:17 
2017 +0100| [6d11b2f6567619cfa40b7e3809572818c7fc41b9] | committer: Clément 
Bœsch

Merge commit 'b2939a75270bc7e971462648168aa3a2a48c1c8c'

* commit 'b2939a75270bc7e971462648168aa3a2a48c1c8c':
  blockdsp: Change type of array stride parameters to ptrdiff_t

Merged-by: Clément Bœsch 

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

 libavcodec/blockdsp.c   | 6 --
 libavcodec/blockdsp.h   | 3 ++-
 libavcodec/mips/blockdsp_mips.h | 8 
 libavcodec/mips/blockdsp_mmi.c  | 4 ++--
 libavcodec/mips/blockdsp_msa.c  | 4 ++--
 5 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/libavcodec/blockdsp.c b/libavcodec/blockdsp.c
index a5c527a..c7efe7e 100644
--- a/libavcodec/blockdsp.c
+++ b/libavcodec/blockdsp.c
@@ -35,7 +35,8 @@ static void clear_blocks_c(int16_t *blocks)
 memset(blocks, 0, sizeof(int16_t) * 6 * 64);
 }
 
-static void fill_block16_c(uint8_t *block, uint8_t value, int line_size, int h)
+static void fill_block16_c(uint8_t *block, uint8_t value, ptrdiff_t line_size,
+   int h)
 {
 int i;
 
@@ -45,7 +46,8 @@ static void fill_block16_c(uint8_t *block, uint8_t value, int 
line_size, int h)
 }
 }
 
-static void fill_block8_c(uint8_t *block, uint8_t value, int line_size, int h)
+static void fill_block8_c(uint8_t *block, uint8_t value, ptrdiff_t line_size,
+  int h)
 {
 int i;
 
diff --git a/libavcodec/blockdsp.h b/libavcodec/blockdsp.h
index 95e1d0f..6e27a02 100644
--- a/libavcodec/blockdsp.h
+++ b/libavcodec/blockdsp.h
@@ -19,6 +19,7 @@
 #ifndef AVCODEC_BLOCKDSP_H
 #define AVCODEC_BLOCKDSP_H
 
+#include 
 #include 
 
 #include "avcodec.h"
@@ -29,7 +30,7 @@
  * h for op_pixels_func is limited to { width / 2, width },
  * but never larger than 16 and never smaller than 4. */
 typedef void (*op_fill_func)(uint8_t *block /* align width (8 or 16) */,
- uint8_t value, int line_size, int h);
+ uint8_t value, ptrdiff_t line_size, int h);
 
 typedef struct BlockDSPContext {
 void (*clear_block)(int16_t *block /* align 16 */);
diff --git a/libavcodec/mips/blockdsp_mips.h b/libavcodec/mips/blockdsp_mips.h
index 9559d40..1742b12 100644
--- a/libavcodec/mips/blockdsp_mips.h
+++ b/libavcodec/mips/blockdsp_mips.h
@@ -24,13 +24,13 @@
 
 #include "../mpegvideo.h"
 
-void ff_fill_block16_msa(uint8_t *src, uint8_t val, int stride, int height);
-void ff_fill_block8_msa(uint8_t *src, uint8_t val, int stride, int height);
+void ff_fill_block16_msa(uint8_t *src, uint8_t val, ptrdiff_t stride, int 
height);
+void ff_fill_block8_msa(uint8_t *src, uint8_t val, ptrdiff_t stride, int 
height);
 void ff_clear_block_msa(int16_t *block);
 void ff_clear_blocks_msa(int16_t *block);
 
-void ff_fill_block16_mmi(uint8_t *block, uint8_t value, int line_size, int h);
-void ff_fill_block8_mmi(uint8_t *block, uint8_t value, int line_size, int h);
+void ff_fill_block16_mmi(uint8_t *block, uint8_t value, ptrdiff_t line_size, 
int h);
+void ff_fill_block8_mmi(uint8_t *block, uint8_t value, ptrdiff_t line_size, 
int h);
 void ff_clear_block_mmi(int16_t *block);
 void ff_clear_blocks_mmi(int16_t *block);
 
diff --git a/libavcodec/mips/blockdsp_mmi.c b/libavcodec/mips/blockdsp_mmi.c
index 1035dbb..68641e2 100644
--- a/libavcodec/mips/blockdsp_mmi.c
+++ b/libavcodec/mips/blockdsp_mmi.c
@@ -24,7 +24,7 @@
 #include "blockdsp_mips.h"
 #include "libavutil/mips/mmiutils.h"
 
-void ff_fill_block16_mmi(uint8_t *block, uint8_t value, int line_size, int h)
+void ff_fill_block16_mmi(uint8_t *block, uint8_t value, ptrdiff_t line_size, 
int h)
 {
 double ftmp[1];
 DECLARE_VAR_ALL64;
@@ -48,7 +48,7 @@ void ff_fill_block16_mmi(uint8_t *block, uint8_t value, int 
line_size, int h)
 );
 }
 
-void ff_fill_block8_mmi(uint8_t *block, uint8_t value, int line_size, int h)
+void ff_fill_block8_mmi(uint8_t *block, uint8_t value, ptrdiff_t line_size, 
int h)
 {
 double ftmp0;
 DECLARE_VAR_ALL64;
diff --git a/libavcodec/mips/blockdsp_msa.c b/libavcodec/mips/blockdsp_msa.c
index 32ac858..2b78c28 100644
--- a/libavcodec/mips/blockdsp_msa.c
+++ b/libavcodec/mips/blockdsp_msa.c
@@ -65,12 +65,12 @@ static void memset_zero_16width_msa(uint8_t *src, int32_t 
stride,
 }
 }
 
-void ff_fill_block16_msa(uint8_t *src, uint8_t val, int stride, int height)
+void ff_fill_block16_msa(uint8_t *src, uint8_t val, ptrdiff_t stride, int 
height)
 {
 copy_8bit_value_width16_msa(src, val, stride, height);
 }
 
-void ff_fill_block8_msa(uint8_t *src, uint8_t val, int stride, int height)
+void ff_fill_block8_msa(uint8_t *src, uint8_t val, ptrdiff_t stride, int 
height)
 {
 copy_8bit_value_width8_msa(src, val, stride, height);
 }


==

diff --cc libavcodec/mips/blockdsp_mips.h
index 

[FFmpeg-cvslog] Merge commit '92c5755a185086067fe49e7e64c23a8e7011be31'

2017-03-21 Thread Clément Bœsch
ffmpeg | branch: master | Clément Bœsch  | Tue Mar 21 15:10:46 
2017 +0100| [51b5672f49f54fbdeaf9828de1f806b1243a6e3d] | committer: Clément 
Bœsch

Merge commit '92c5755a185086067fe49e7e64c23a8e7011be31'

* commit '92c5755a185086067fe49e7e64c23a8e7011be31':
  hpeldsp: arm: Update comments left behind in 
25841dfe806a13de526ae09c11149ab1f83555a8

Merged-by: Clément Bœsch 

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

 libavcodec/arm/hpeldsp_arm.S | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/libavcodec/arm/hpeldsp_arm.S b/libavcodec/arm/hpeldsp_arm.S
index 219f793..6f3e3fb 100644
--- a/libavcodec/arm/hpeldsp_arm.S
+++ b/libavcodec/arm/hpeldsp_arm.S
@@ -90,7 +90,7 @@
 
 @ 
 function ff_put_pixels16_arm, export=1, align=5
-@ void func(uint8_t *block, const uint8_t *pixels, int line_size, int 
h)
+@ void func(uint8_t *block, const uint8_t *pixels, ptrdiff_t 
line_size, int h)
 @ block = word aligned, pixles = unaligned
 pld [r1]
 push{r4-r11, lr}
@@ -141,7 +141,7 @@ endfunc
 
 @ 
 function ff_put_pixels8_arm, export=1, align=5
-@ void func(uint8_t *block, const uint8_t *pixels, int line_size, int 
h)
+@ void func(uint8_t *block, const uint8_t *pixels, ptrdiff_t 
line_size, int h)
 @ block = word aligned, pixles = unaligned
 pld [r1]
 push{r4-r5,lr}
@@ -192,7 +192,7 @@ endfunc
 
 @ 
 function ff_put_pixels8_x2_arm, export=1, align=5
-@ void func(uint8_t *block, const uint8_t *pixels, int line_size, int 
h)
+@ void func(uint8_t *block, const uint8_t *pixels, ptrdiff_t 
line_size, int h)
 @ block = word aligned, pixles = unaligned
 pld [r1]
 push{r4-r10,lr}
@@ -250,7 +250,7 @@ function ff_put_pixels8_x2_arm, export=1, align=5
 endfunc
 
 function ff_put_no_rnd_pixels8_x2_arm, export=1, align=5
-@ void func(uint8_t *block, const uint8_t *pixels, int line_size, int 
h)
+@ void func(uint8_t *block, const uint8_t *pixels, ptrdiff_t 
line_size, int h)
 @ block = word aligned, pixles = unaligned
 pld [r1]
 push{r4-r10,lr}
@@ -310,7 +310,7 @@ endfunc
 
 @ 
 function ff_put_pixels8_y2_arm, export=1, align=5
-@ void func(uint8_t *block, const uint8_t *pixels, int line_size, int 
h)
+@ void func(uint8_t *block, const uint8_t *pixels, ptrdiff_t 
line_size, int h)
 @ block = word aligned, pixles = unaligned
 pld [r1]
 push{r4-r11,lr}
@@ -407,7 +407,7 @@ function ff_put_pixels8_y2_arm, export=1, align=5
 endfunc
 
 function ff_put_no_rnd_pixels8_y2_arm, export=1, align=5
-@ void func(uint8_t *block, const uint8_t *pixels, int line_size, int 
h)
+@ void func(uint8_t *block, const uint8_t *pixels, ptrdiff_t 
line_size, int h)
 @ block = word aligned, pixles = unaligned
 pld [r1]
 push{r4-r11,lr}
@@ -573,7 +573,7 @@ endfunc
 .endm
 
 function ff_put_pixels8_xy2_arm, export=1, align=5
-@ void func(uint8_t *block, const uint8_t *pixels, int line_size, int 
h)
+@ void func(uint8_t *block, const uint8_t *pixels, ptrdiff_t 
line_size, int h)
 @ block = word aligned, pixles = unaligned
 pld [r1]
 push{r4-r11,lr} @ R14 is also called LR
@@ -588,7 +588,7 @@ function ff_put_pixels8_xy2_arm, export=1, align=5
 endfunc
 
 function ff_put_no_rnd_pixels8_xy2_arm, export=1, align=5
-@ void func(uint8_t *block, const uint8_t *pixels, int line_size, int 
h)
+@ void func(uint8_t *block, const uint8_t *pixels, ptrdiff_t 
line_size, int h)
 @ block = word aligned, pixles = unaligned
 pld [r1]
 push{r4-r11,lr}


==


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


[FFmpeg-cvslog] hpeldsp: arm: Update comments left behind in 25841dfe806a13de526ae09c11149ab1f83555a8

2017-03-21 Thread Diego Biurrun
ffmpeg | branch: master | Diego Biurrun  | Sun Sep 11 
23:17:31 2016 +0200| [92c5755a185086067fe49e7e64c23a8e7011be31] | committer: 
Diego Biurrun

hpeldsp: arm: Update comments left behind in 
25841dfe806a13de526ae09c11149ab1f83555a8

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

 libavcodec/arm/hpeldsp_arm.S | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/libavcodec/arm/hpeldsp_arm.S b/libavcodec/arm/hpeldsp_arm.S
index 0f8092e..6eb4837 100644
--- a/libavcodec/arm/hpeldsp_arm.S
+++ b/libavcodec/arm/hpeldsp_arm.S
@@ -90,7 +90,7 @@
 
 @ 
 function ff_put_pixels16_arm, export=1, align=5
-@ void func(uint8_t *block, const uint8_t *pixels, int line_size, int 
h)
+@ void func(uint8_t *block, const uint8_t *pixels, ptrdiff_t 
line_size, int h)
 @ block = word aligned, pixles = unaligned
 pld [r1]
 push{r4-r11, lr}
@@ -141,7 +141,7 @@ endfunc
 
 @ 
 function ff_put_pixels8_arm, export=1, align=5
-@ void func(uint8_t *block, const uint8_t *pixels, int line_size, int 
h)
+@ void func(uint8_t *block, const uint8_t *pixels, ptrdiff_t 
line_size, int h)
 @ block = word aligned, pixles = unaligned
 pld [r1]
 push{r4-r5,lr}
@@ -192,7 +192,7 @@ endfunc
 
 @ 
 function ff_put_pixels8_x2_arm, export=1, align=5
-@ void func(uint8_t *block, const uint8_t *pixels, int line_size, int 
h)
+@ void func(uint8_t *block, const uint8_t *pixels, ptrdiff_t 
line_size, int h)
 @ block = word aligned, pixles = unaligned
 pld [r1]
 push{r4-r10,lr}
@@ -250,7 +250,7 @@ function ff_put_pixels8_x2_arm, export=1, align=5
 endfunc
 
 function ff_put_no_rnd_pixels8_x2_arm, export=1, align=5
-@ void func(uint8_t *block, const uint8_t *pixels, int line_size, int 
h)
+@ void func(uint8_t *block, const uint8_t *pixels, ptrdiff_t 
line_size, int h)
 @ block = word aligned, pixles = unaligned
 pld [r1]
 push{r4-r10,lr}
@@ -310,7 +310,7 @@ endfunc
 
 @ 
 function ff_put_pixels8_y2_arm, export=1, align=5
-@ void func(uint8_t *block, const uint8_t *pixels, int line_size, int 
h)
+@ void func(uint8_t *block, const uint8_t *pixels, ptrdiff_t 
line_size, int h)
 @ block = word aligned, pixles = unaligned
 pld [r1]
 push{r4-r11,lr}
@@ -407,7 +407,7 @@ function ff_put_pixels8_y2_arm, export=1, align=5
 endfunc
 
 function ff_put_no_rnd_pixels8_y2_arm, export=1, align=5
-@ void func(uint8_t *block, const uint8_t *pixels, int line_size, int 
h)
+@ void func(uint8_t *block, const uint8_t *pixels, ptrdiff_t 
line_size, int h)
 @ block = word aligned, pixles = unaligned
 pld [r1]
 push{r4-r11,lr}
@@ -573,7 +573,7 @@ endfunc
 .endm
 
 function ff_put_pixels8_xy2_arm, export=1, align=5
-@ void func(uint8_t *block, const uint8_t *pixels, int line_size, int 
h)
+@ void func(uint8_t *block, const uint8_t *pixels, ptrdiff_t 
line_size, int h)
 @ block = word aligned, pixles = unaligned
 pld [r1]
 push{r4-r11,lr} @ R14 is also called LR
@@ -588,7 +588,7 @@ function ff_put_pixels8_xy2_arm, export=1, align=5
 endfunc
 
 function ff_put_no_rnd_pixels8_xy2_arm, export=1, align=5
-@ void func(uint8_t *block, const uint8_t *pixels, int line_size, int 
h)
+@ void func(uint8_t *block, const uint8_t *pixels, ptrdiff_t 
line_size, int h)
 @ block = word aligned, pixles = unaligned
 pld [r1]
 push{r4-r11,lr}

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


[FFmpeg-cvslog] vaapi_encode: Check packed header capabilities

2017-03-21 Thread Mark Thompson
ffmpeg | branch: master | Mark Thompson  | Sun Sep 18 14:59:59 
2016 +0100| [892bbbcdc171ff0d08d69636a240ffb95f54243c] | committer: Mark 
Thompson

vaapi_encode: Check packed header capabilities

This improves behaviour with drivers which do not support packed
headers, such as AMD VCE on mesa/gallium.

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

 libavcodec/vaapi_encode.c   | 36 +---
 libavcodec/vaapi_encode.h   |  3 +++
 libavcodec/vaapi_encode_h264.c  |  4 
 libavcodec/vaapi_encode_h265.c  |  3 +++
 libavcodec/vaapi_encode_mjpeg.c | 15 +++
 5 files changed, 54 insertions(+), 7 deletions(-)

diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c
index 41d1a6e..7ec5340 100644
--- a/libavcodec/vaapi_encode.c
+++ b/libavcodec/vaapi_encode.c
@@ -237,7 +237,8 @@ static int vaapi_encode_issue(AVCodecContext *avctx,
 }
 
 if (pic->type == PICTURE_TYPE_IDR) {
-if (ctx->codec->write_sequence_header) {
+if (ctx->va_packed_headers & VA_ENC_PACKED_HEADER_SEQUENCE &&
+ctx->codec->write_sequence_header) {
 bit_len = 8 * sizeof(data);
 err = ctx->codec->write_sequence_header(avctx, data, _len);
 if (err < 0) {
@@ -253,7 +254,8 @@ static int vaapi_encode_issue(AVCodecContext *avctx,
 }
 }
 
-if (ctx->codec->write_picture_header) {
+if (ctx->va_packed_headers & VA_ENC_PACKED_HEADER_PICTURE &&
+ctx->codec->write_picture_header) {
 bit_len = 8 * sizeof(data);
 err = ctx->codec->write_picture_header(avctx, pic, data, _len);
 if (err < 0) {
@@ -289,7 +291,8 @@ static int vaapi_encode_issue(AVCodecContext *avctx,
 }
 }
 
-if (ctx->codec->write_extra_header) {
+if (ctx->va_packed_headers & VA_ENC_PACKED_HEADER_MISC &&
+ctx->codec->write_extra_header) {
 for (i = 0;; i++) {
 int type;
 bit_len = 8 * sizeof(data);
@@ -336,7 +339,8 @@ static int vaapi_encode_issue(AVCodecContext *avctx,
 }
 }
 
-if (ctx->codec->write_slice_header) {
+if (ctx->va_packed_headers & VA_ENC_PACKED_HEADER_SLICE &&
+ctx->codec->write_slice_header) {
 bit_len = 8 * sizeof(data);
 err = ctx->codec->write_slice_header(avctx, pic, slice,
  data, _len);
@@ -930,9 +934,10 @@ static av_cold int 
vaapi_encode_config_attributes(AVCodecContext *avctx)
 VAProfile*profiles= NULL;
 VAEntrypoint *entrypoints = NULL;
 VAConfigAttrib attr[] = {
-{ VAConfigAttribRTFormat},
-{ VAConfigAttribRateControl },
-{ VAConfigAttribEncMaxRefFrames },
+{ VAConfigAttribRTFormat },
+{ VAConfigAttribRateControl  },
+{ VAConfigAttribEncMaxRefFrames  },
+{ VAConfigAttribEncPackedHeaders },
 };
 
 n = vaMaxNumProfiles(ctx->hwctx->display);
@@ -1049,6 +1054,23 @@ static av_cold int 
vaapi_encode_config_attributes(AVCodecContext *avctx)
 }
 }
 break;
+case VAConfigAttribEncPackedHeaders:
+if (ctx->va_packed_headers & ~attr[i].value) {
+// This isn't fatal, but packed headers are always
+// preferable because they are under our control.
+// When absent, the driver is generating them and some
+// features may not work (e.g. VUI or SEI in H.264).
+av_log(avctx, AV_LOG_WARNING, "Warning: some packed "
+   "headers are not supported (want %#x, got %#x).\n",
+   ctx->va_packed_headers, attr[i].value);
+ctx->va_packed_headers &= attr[i].value;
+}
+ctx->config_attributes[ctx->nb_config_attributes++] =
+(VAConfigAttrib) {
+.type  = VAConfigAttribEncPackedHeaders,
+.value = ctx->va_packed_headers,
+};
+break;
 default:
 av_assert0(0 && "Unexpected config attribute.");
 }
diff --git a/libavcodec/vaapi_encode.h b/libavcodec/vaapi_encode.h
index 71f6087..c47d979 100644
--- a/libavcodec/vaapi_encode.h
+++ b/libavcodec/vaapi_encode.h
@@ -101,6 +101,9 @@ typedef struct VAAPIEncodeContext {
 unsigned intva_rt_format;
 // Rate control mode.
 unsigned intva_rc_mode;
+// Supported packed headers (initially the desired set, modified
+// later to what is actually supported).
+unsigned intva_packed_headers;
 
 // The required size of surfaces.  This is probably the input
 // size (AVCodecContext.width|height) aligned up to whatever
diff --git a/libavcodec/vaapi_encode_h264.c b/libavcodec/vaapi_encode_h264.c
index d9b1868..0cd966f 100644
--- a/libavcodec/vaapi_encode_h264.c
+++ b/libavcodec/vaapi_encode_h264.c
@@ -1221,6 

[FFmpeg-cvslog] Merge commit '009adfd4fbdd78a890a4a65d6f141c467bb027fa'

2017-03-21 Thread Clément Bœsch
ffmpeg | branch: master | Clément Bœsch  | Tue Mar 21 15:02:31 
2017 +0100| [f54da138e98ca9f0de1fa9d9ff7e05a91553ab57] | committer: Clément 
Bœsch

Merge commit '009adfd4fbdd78a890a4a65d6f141c467bb027fa'

* commit '009adfd4fbdd78a890a4a65d6f141c467bb027fa':
  x86: fpel: Remove unnecessary sign extend

Merged-by: Clément Bœsch 

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

 libavcodec/x86/fpel.asm | 1 -
 1 file changed, 1 deletion(-)

diff --git a/libavcodec/x86/fpel.asm b/libavcodec/x86/fpel.asm
index 0e3b444..961a158 100644
--- a/libavcodec/x86/fpel.asm
+++ b/libavcodec/x86/fpel.asm
@@ -48,7 +48,6 @@ SECTION .text
 %define LEN  %2
 %endif
 cglobal %1_pixels%2, 4,5,4
-movsxdifnidn r2, r2d
 lea  r4, [r2*3]
 %ifidn %1, avg
 %if notcpuflag(mmxext)


==

diff --cc libavcodec/x86/fpel.asm
index 0e3b444,b1be289..961a158
--- a/libavcodec/x86/fpel.asm
+++ b/libavcodec/x86/fpel.asm
@@@ -25,65 -25,34 +25,64 @@@
  
  SECTION .text
  
 -INIT_MMX mmxext
 +%macro PAVGB_MMX 4
 +LOAD   %3, %1
 +por%3, %2
 +pxor   %2, %1
 +pand   %2, %4
 +psrlq  %2, 1
 +psubb  %3, %2
 +SWAP   %2, %3
 +%endmacro
 +
  ; void ff_put/avg_pixels(uint8_t *block, const uint8_t *pixels,
  ;ptrdiff_t line_size, int h)
 -%macro PIXELS48 2
 -%if %2 == 4
 -%define OP movh
 +%macro OP_PIXELS 2
 +%if %2 == mmsize/2
 +%define LOAD movh
 +%define SAVE movh
 +%define LEN  mmsize
  %else
 -%define OP mova
 +%define LOAD movu
 +%define SAVE mova
 +%define LEN  %2
  %endif
 -cglobal %1_pixels%2, 4,5
 +cglobal %1_pixels%2, 4,5,4
- movsxdifnidn r2, r2d
  lea  r4, [r2*3]
 +%ifidn %1, avg
 +%if notcpuflag(mmxext)
 +pcmpeqd  m6, m6
 +paddbm6, m6
 +%endif
 +%endif
  .loop:
 -OP   m0, [r1]
 -OP   m1, [r1+r2]
 -OP   m2, [r1+r2*2]
 -OP   m3, [r1+r4]
 -lea  r1, [r1+r2*4]
 +%assign %%i 0
 +%rep LEN/mmsize
 +LOAD m0, [r1 + %%i]
 +LOAD m1, [r1+r2 + %%i]
 +LOAD m2, [r1+r2*2 + %%i]
 +LOAD m3, [r1+r4 + %%i]
  %ifidn %1, avg
 -pavgbm0, [r0]
 -pavgbm1, [r0+r2]
 -pavgbm2, [r0+r2*2]
 -pavgbm3, [r0+r4]
 +%if notcpuflag(mmxext)
 +PAVGB_MMX[r0 + %%i], m0, m4, m6
 +PAVGB_MMX[r0+r2 + %%i], m1, m5, m6
 +PAVGB_MMX[r0+r2*2 + %%i], m2, m4, m6
 +PAVGB_MMX[r0+r4 + %%i], m3, m5, m6
 +%else
 +pavgbm0, [r0 + %%i]
 +pavgbm1, [r0+r2 + %%i]
 +pavgbm2, [r0+r2*2 + %%i]
 +pavgbm3, [r0+r4 + %%i]
 +%endif
  %endif
 -OP [r0], m0
 -OP  [r0+r2], m1
 -OP[r0+r2*2], m2
 -OP  [r0+r4], m3
 +SAVE   [r0 + %%i], m0
 +SAVE[r0+r2 + %%i], m1
 +SAVE  [r0+r2*2 + %%i], m2
 +SAVE[r0+r4 + %%i], m3
 +%assign %%i %%i+mmsize
 +%endrep
  sub r3d, 4
 +lea  r1, [r1+r2*4]
  lea  r0, [r0+r2*4]
  jne   .loop
  RET

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


[FFmpeg-cvslog] x86: fpel: Remove unnecessary sign extend

2017-03-21 Thread Diego Biurrun
ffmpeg | branch: master | Diego Biurrun  | Fri Sep 16 
13:13:28 2016 +0200| [009adfd4fbdd78a890a4a65d6f141c467bb027fa] | committer: 
Diego Biurrun

x86: fpel: Remove unnecessary sign extend

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

 libavcodec/x86/fpel.asm | 1 -
 1 file changed, 1 deletion(-)

diff --git a/libavcodec/x86/fpel.asm b/libavcodec/x86/fpel.asm
index b581471..b1be289 100644
--- a/libavcodec/x86/fpel.asm
+++ b/libavcodec/x86/fpel.asm
@@ -35,7 +35,6 @@ INIT_MMX mmxext
 %define OP mova
 %endif
 cglobal %1_pixels%2, 4,5
-movsxdifnidn r2, r2d
 lea  r4, [r2*3]
 .loop:
 OP   m0, [r1]

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


[FFmpeg-cvslog] vaapi_encode: Sync to input surface rather than output

2017-03-21 Thread Mark Thompson
ffmpeg | branch: master | Mark Thompson  | Sun Sep 18 16:06:55 
2016 +0100| [086e4b58b59ea3993107aa24d92bb962ec69667c] | committer: Mark 
Thompson

vaapi_encode: Sync to input surface rather than output

While outwardly bizarre, this change makes the behaviour consistent
with other VAAPI encoders which sync to the encode /input/ picture in
order to wait for /output/ from the encoder.  It is not harmful on
i965 (because synchronisation already happens in vaRenderPicture(),
so it has no effect there), and it allows the encoder to work on
mesa/gallium which assumes this behaviour.

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

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

diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c
index 7ec5340..dc6cdfe 100644
--- a/libavcodec/vaapi_encode.c
+++ b/libavcodec/vaapi_encode.c
@@ -109,10 +109,10 @@ static int vaapi_encode_wait(AVCodecContext *avctx,
 }
 
 av_log(avctx, AV_LOG_DEBUG, "Sync to pic %"PRId64"/%"PRId64" "
-   "(recon surface %#x).\n", pic->display_order,
-   pic->encode_order, pic->recon_surface);
+   "(input surface %#x).\n", pic->display_order,
+   pic->encode_order, pic->input_surface);
 
-vas = vaSyncSurface(ctx->hwctx->display, pic->recon_surface);
+vas = vaSyncSurface(ctx->hwctx->display, pic->input_surface);
 if (vas != VA_STATUS_SUCCESS) {
 av_log(avctx, AV_LOG_ERROR, "Failed to sync to picture completion: "
"%d (%s).\n", vas, vaErrorStr(vas));

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


[FFmpeg-cvslog] vaapi_h264: Set max_num_ref_frames to 1 when not using B frames

2017-03-21 Thread Mark Thompson
ffmpeg | branch: master | Mark Thompson  | Tue Sep 27 19:08:42 
2016 +0100| [956a54129db522998a5abae869568dae2c9774cb] | committer: Mark 
Thompson

vaapi_h264: Set max_num_ref_frames to 1 when not using B frames

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

 libavcodec/vaapi_encode_h264.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/vaapi_encode_h264.c b/libavcodec/vaapi_encode_h264.c
index 0cd966f..020f892 100644
--- a/libavcodec/vaapi_encode_h264.c
+++ b/libavcodec/vaapi_encode_h264.c
@@ -778,7 +778,7 @@ static int 
vaapi_encode_h264_init_sequence_params(AVCodecContext *avctx)
 
 vseq->level_idc = avctx->level;
 
-vseq->max_num_ref_frames = 2;
+vseq->max_num_ref_frames = 1 + (avctx->max_b_frames > 0);
 
 vseq->picture_width_in_mbs  = priv->mb_width;
 vseq->picture_height_in_mbs = priv->mb_height;

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


[FFmpeg-cvslog] vaapi_encode: Refactor initialisation

2017-03-21 Thread Mark Thompson
ffmpeg | branch: master | Mark Thompson  | Sun Sep 18 14:55:26 
2016 +0100| [80a5d05108cb218e8cd2e25c6621a3bfef0a832e] | committer: Mark 
Thompson

vaapi_encode: Refactor initialisation

This allows better checking of capabilities and will make it easier
to add more functionality later.

It also commonises some duplicated code around rate control setup
and adds more comments explaining the internals.

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

 libavcodec/vaapi_encode.c   | 253 ++--
 libavcodec/vaapi_encode.h   |  96 ++-
 libavcodec/vaapi_encode_h264.c  | 253 +++-
 libavcodec/vaapi_encode_h265.c  | 208 -
 libavcodec/vaapi_encode_mjpeg.c |  45 +++
 5 files changed, 418 insertions(+), 437 deletions(-)

diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c
index cdda485..41d1a6e 100644
--- a/libavcodec/vaapi_encode.c
+++ b/libavcodec/vaapi_encode.c
@@ -922,7 +922,7 @@ fail:
 return err;
 }
 
-static av_cold int vaapi_encode_check_config(AVCodecContext *avctx)
+static av_cold int vaapi_encode_config_attributes(AVCodecContext *avctx)
 {
 VAAPIEncodeContext *ctx = avctx->priv_data;
 VAStatus vas;
@@ -930,6 +930,7 @@ static av_cold int vaapi_encode_check_config(AVCodecContext 
*avctx)
 VAProfile*profiles= NULL;
 VAEntrypoint *entrypoints = NULL;
 VAConfigAttrib attr[] = {
+{ VAConfigAttribRTFormat},
 { VAConfigAttribRateControl },
 { VAConfigAttribEncMaxRefFrames },
 };
@@ -1001,13 +1002,33 @@ static av_cold int 
vaapi_encode_check_config(AVCodecContext *avctx)
 continue;
 }
 switch (attr[i].type) {
+case VAConfigAttribRTFormat:
+if (!(ctx->va_rt_format & attr[i].value)) {
+av_log(avctx, AV_LOG_ERROR, "Surface RT format %#x "
+   "is not supported (mask %#x).\n",
+   ctx->va_rt_format, attr[i].value);
+err = AVERROR(EINVAL);
+goto fail;
+}
+ctx->config_attributes[ctx->nb_config_attributes++] =
+(VAConfigAttrib) {
+.type  = VAConfigAttribRTFormat,
+.value = ctx->va_rt_format,
+};
+break;
 case VAConfigAttribRateControl:
 if (!(ctx->va_rc_mode & attr[i].value)) {
-av_log(avctx, AV_LOG_ERROR, "Rate control mode is not "
-   "supported: %x\n", attr[i].value);
+av_log(avctx, AV_LOG_ERROR, "Rate control mode %#x "
+   "is not supported (mask: %#x).\n",
+   ctx->va_rc_mode, attr[i].value);
 err = AVERROR(EINVAL);
 goto fail;
 }
+ctx->config_attributes[ctx->nb_config_attributes++] =
+(VAConfigAttrib) {
+.type  = VAConfigAttribRateControl,
+.value = ctx->va_rc_mode,
+};
 break;
 case VAConfigAttribEncMaxRefFrames:
 {
@@ -1016,18 +1037,20 @@ static av_cold int 
vaapi_encode_check_config(AVCodecContext *avctx)
 
 if (avctx->gop_size > 1 && ref_l0 < 1) {
 av_log(avctx, AV_LOG_ERROR, "P frames are not "
-   "supported (%x).\n", attr[i].value);
+   "supported (%#x).\n", attr[i].value);
 err = AVERROR(EINVAL);
 goto fail;
 }
 if (avctx->max_b_frames > 0 && ref_l1 < 1) {
 av_log(avctx, AV_LOG_ERROR, "B frames are not "
-   "supported (%x).\n", attr[i].value);
+   "supported (%#x).\n", attr[i].value);
 err = AVERROR(EINVAL);
 goto fail;
 }
 }
 break;
+default:
+av_assert0(0 && "Unexpected config attribute.");
 }
 }
 
@@ -1038,6 +1061,48 @@ fail:
 return err;
 }
 
+static av_cold int vaapi_encode_init_rate_control(AVCodecContext *avctx)
+{
+VAAPIEncodeContext *ctx = avctx->priv_data;
+int hrd_buffer_size;
+int hrd_initial_buffer_fullness;
+
+if (avctx->rc_buffer_size)
+hrd_buffer_size = avctx->rc_buffer_size;
+else
+hrd_buffer_size = avctx->bit_rate;
+if (avctx->rc_initial_buffer_occupancy)
+hrd_initial_buffer_fullness = avctx->rc_initial_buffer_occupancy;
+else
+hrd_initial_buffer_fullness = hrd_buffer_size * 3 / 4;
+
+ctx->rc_params.misc.type = VAEncMiscParameterTypeRateControl;
+ctx->rc_params.rc = (VAEncMiscParameterRateControl) {
+.bits_per_second   = avctx->bit_rate,
+.target_percentage = 66,
+.window_size   = 1000,
+.initial_qp= (avctx->qmax >= 0 ? avctx->qmax : 40),
+

[FFmpeg-cvslog] Merge commit '956a54129db522998a5abae869568dae2c9774cb'

2017-03-21 Thread Clément Bœsch
ffmpeg | branch: master | Clément Bœsch  | Tue Mar 21 14:58:03 
2017 +0100| [267cb20e2bf36074e235449395f570847186c1d9] | committer: Clément 
Bœsch

Merge commit '956a54129db522998a5abae869568dae2c9774cb'

* commit '956a54129db522998a5abae869568dae2c9774cb':
  vaapi_h264: Set max_num_ref_frames to 1 when not using B frames
  vaapi_encode: Sync to input surface rather than output
  vaapi_encode: Check packed header capabilities
  vaapi_encode: Refactor initialisation

This merge is a noop, see:

ee1d04f970 vaapi_h264: Set max_num_ref_frames to 1 when not using B frames
94f446c628 vaapi_encode: Sync to input surface rather than output
478a4b7e6d vaapi_encode: Check packed header capabilities
c8241e730f vaapi_encode: Refactor initialisation

Merged-by: Clément Bœsch 

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



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


[FFmpeg-cvslog] Merge commit '67d28f4a0fbb52d0734ca3682b85035e96d294fb'

2017-03-21 Thread Clément Bœsch
ffmpeg | branch: master | Clément Bœsch  | Tue Mar 21 14:51:38 
2017 +0100| [bb7cc5b5d928cbc948881f4f9b8b055129fe0f0b] | committer: Clément 
Bœsch

Merge commit '67d28f4a0fbb52d0734ca3682b85035e96d294fb'

* commit '67d28f4a0fbb52d0734ca3682b85035e96d294fb':
  examples/output: switch to the new encoding API

This commit is a noop, our examples are different. Still, we need to
update them to the new API, so doc/libav-merge.txt is updated.

Merged-by: Clément Bœsch 

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

 doc/libav-merge.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/doc/libav-merge.txt b/doc/libav-merge.txt
index 7a82b7b..e94a749 100644
--- a/doc/libav-merge.txt
+++ b/doc/libav-merge.txt
@@ -95,6 +95,7 @@ Stuff that didn't reach the codebase:
   - 0cef06df0 checkasm: add HEVC MC tests
   - e7078e842 hevcdsp: add x86 SIMD for MC
 - VAAPI VP8 decode hwaccel (currently under review: 
http://ffmpeg.org/pipermail/ffmpeg-devel/2017-February/thread.html#207348)
+- Switching examples to the new encode/decode API (see 67d28f4a0f)
 
 Collateral damage that needs work locally:
 --


==

diff --cc doc/libav-merge.txt
index 7a82b7b,000..e94a749
mode 100644,00..100644
--- a/doc/libav-merge.txt
+++ b/doc/libav-merge.txt
@@@ -1,104 -1,0 +1,105 @@@
 +CONTEXT
 +===
 +
 +The FFmpeg project merges all the changes from the Libav project
 +(https://libav.org) since the origin of the fork (around 2011).
 +
 +With the exceptions of some commits due to technical/political disagreements 
or
 +issues, the changes are merged on a more or less regular schedule (daily for
 +years thanks to Michael, but more sparse nowadays).
 +
 +WHY
 +===
 +
 +The majority of the active developers believe the project needs to keep this
 +policy for various reasons.
 +
 +The most important one is that we don't want our users to have to choose
 +between two distributors of libraries of the exact same name in order to have 
a
 +different set of features and bugfixes. By taking the responsibility of
 +unifying the two codebases, we allow users to benefit from the changes from 
the
 +two teams.
 +
 +Today, FFmpeg has a much larger user database (we are distributed by every
 +major distribution), so we consider this mission a priority.
 +
 +A different approach to the merge could have been to pick the changes we are
 +interested in and drop most of the cosmetics and other less important changes.
 +Unfortunately, this makes the following picks much harder, especially since 
the
 +Libav project is involved in various deep API changes. As a result, we decide
 +to virtually take everything done there.
 +
 +Any Libav developer is of course welcome anytime to contribute directly to the
 +FFmpeg tree. Of course, we fully understand and are forced to accept that very
 +few Libav developers are interested in doing so, but we still want to 
recognize
 +their work. This leads us to create merge commits for every single one from
 +Libav. The original commit appears totally unchanged with full authorship in
 +our history (and the conflict are solved in the merge one). That way, not a
 +single thing from Libav will be lost in the future in case some reunification
 +happens, or that project disappears one way or another.
 +
 +DOWNSIDES
 +=
 +
 +Of course, there are many downsides to this approach.
 +
 +- It causes a non negligible merge commits pollution. We make sure there are
 +  not several level of merges entangled (we do a 1:1 merge/commit), but it's
 +  still a non-linear history.
 +
 +- Many duplicated work. For instance, we added libavresample in our tree to
 +  keep compatibility with Libav when our libswresample was already covering 
the
 +  exact same purpose. The same thing happened for various elements such as the
 +  ProRes support (but differences in features, bugs, licenses, ...). There are
 +  many work to do to unify them, and any help is very much welcome.
 +
 +- So much manpower from both FFmpeg and Libav is lost because of this mess. We
 +  know it, and we don't know how to fix it. It takes incredible time to do
 +  these merges, so we have even less time to work on things we personally care
 +  about. The bad vibes also do not help with keeping our developers motivated.
 +
 +- There is a growing technical risk factor with the merges due to the codebase
 +  differing more and more.
 +
 +MERGE GUIDELINES
 +
 +
 +The following gives developer guidelines on how to proceed when merging Libav 
commits.
 +
 +Before starting, you can reduce the risk of errors on merge conflicts by using
 +a different merge conflict style:
 +
 +$ git config --global merge.conflictstyle diff3
 +
 +tools/libav-merge-next-commit is a script to help merging the next commit in
 +the queue. It assumes a remote named libav. It has two 

[FFmpeg-cvslog] examples/output: switch to the new encoding API

2017-03-21 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Thu Sep 22 
09:32:08 2016 +0200| [67d28f4a0fbb52d0734ca3682b85035e96d294fb] | committer: 
Anton Khirnov

examples/output: switch to the new encoding API

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

 doc/examples/output.c | 71 +++
 1 file changed, 44 insertions(+), 27 deletions(-)

diff --git a/doc/examples/output.c b/doc/examples/output.c
index 44a55f5..bb0da30 100644
--- a/doc/examples/output.c
+++ b/doc/examples/output.c
@@ -233,25 +233,37 @@ static AVFrame *get_audio_frame(OutputStream *ost)
 static int encode_audio_frame(AVFormatContext *oc, OutputStream *ost,
   AVFrame *frame)
 {
-AVPacket pkt = { 0 }; // data and size must be 0;
-int got_packet;
+int ret;
 
-av_init_packet();
-avcodec_encode_audio2(ost->enc, , frame, _packet);
+ret = avcodec_send_frame(ost->enc, frame);
+if (ret < 0) {
+fprintf(stderr, "Error submitting a frame for encoding\n");
+exit(1);
+}
 
-if (got_packet) {
-pkt.stream_index = ost->st->index;
+while (ret >= 0) {
+AVPacket pkt = { 0 }; // data and size must be 0;
 
-av_packet_rescale_ts(, ost->enc->time_base, ost->st->time_base);
+av_init_packet();
 
-/* Write the compressed frame to the media file. */
-if (av_interleaved_write_frame(oc, ) != 0) {
-fprintf(stderr, "Error while writing audio frame\n");
+ret = avcodec_receive_packet(ost->enc, );
+if (ret < 0 && ret != AVERROR(EAGAIN) && ret != AVERROR_EOF) {
+fprintf(stderr, "Error encoding a video frame\n");
 exit(1);
+} else if (ret >= 0) {
+av_packet_rescale_ts(, ost->enc->time_base, 
ost->st->time_base);
+pkt.stream_index = ost->st->index;
+
+/* Write the compressed frame to the media file. */
+ret = av_interleaved_write_frame(oc, );
+if (ret < 0) {
+fprintf(stderr, "Error while writing video frame\n");
+exit(1);
+}
 }
 }
 
-return (frame || got_packet) ? 0 : 1;
+return ret == AVERROR_EOF;
 }
 
 /*
@@ -517,36 +529,41 @@ static int write_video_frame(AVFormatContext *oc, 
OutputStream *ost)
 int ret;
 AVCodecContext *c;
 AVFrame *frame;
-AVPacket pkt   = { 0 };
-int got_packet = 0;
 
 c = ost->enc;
 
 frame = get_video_frame(ost);
 
-av_init_packet();
-
 /* encode the image */
-ret = avcodec_encode_video2(c, , frame, _packet);
+ret = avcodec_send_frame(c, frame);
 if (ret < 0) {
-fprintf(stderr, "Error encoding a video frame\n");
+fprintf(stderr, "Error submitting a frame for encoding\n");
 exit(1);
 }
 
-if (got_packet) {
-av_packet_rescale_ts(, c->time_base, ost->st->time_base);
-pkt.stream_index = ost->st->index;
+while (ret >= 0) {
+AVPacket pkt = { 0 };
 
-/* Write the compressed frame to the media file. */
-ret = av_interleaved_write_frame(oc, );
-}
+av_init_packet();
 
-if (ret != 0) {
-fprintf(stderr, "Error while writing video frame\n");
-exit(1);
+ret = avcodec_receive_packet(c, );
+if (ret < 0 && ret != AVERROR(EAGAIN) && ret != AVERROR_EOF) {
+fprintf(stderr, "Error encoding a video frame\n");
+exit(1);
+} else if (ret >= 0) {
+av_packet_rescale_ts(, c->time_base, ost->st->time_base);
+pkt.stream_index = ost->st->index;
+
+/* Write the compressed frame to the media file. */
+ret = av_interleaved_write_frame(oc, );
+if (ret < 0) {
+fprintf(stderr, "Error while writing video frame\n");
+exit(1);
+}
+}
 }
 
-return (frame || got_packet) ? 0 : 1;
+return ret == AVERROR_EOF;
 }
 
 static void close_stream(AVFormatContext *oc, OutputStream *ost)

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


[FFmpeg-cvslog] Merge commit '7bf8db4db61eb09fac00eb665d8ec58de8817da6'

2017-03-21 Thread Clément Bœsch
ffmpeg | branch: master | Clément Bœsch  | Tue Mar 21 14:44:44 
2017 +0100| [5dfe343d96dcd2159cb9242304f1336cb0176d11] | committer: Clément 
Bœsch

Merge commit '7bf8db4db61eb09fac00eb665d8ec58de8817da6'

* commit '7bf8db4db61eb09fac00eb665d8ec58de8817da6':
  tdsc: use the new decoding API

Merged-by: Clément Bœsch 

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

 libavcodec/tdsc.c | 15 +--
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/libavcodec/tdsc.c b/libavcodec/tdsc.c
index 8460568..4182404 100644
--- a/libavcodec/tdsc.c
+++ b/libavcodec/tdsc.c
@@ -343,7 +343,6 @@ static int tdsc_decode_jpeg_tile(AVCodecContext *avctx, int 
tile_size,
 {
 TDSCContext *ctx = avctx->priv_data;
 AVPacket jpkt;
-int got_frame = 0;
 int ret;
 
 /* Prepare a packet and send to the MJPEG decoder */
@@ -351,12 +350,16 @@ static int tdsc_decode_jpeg_tile(AVCodecContext *avctx, 
int tile_size,
 jpkt.data = ctx->tilebuffer;
 jpkt.size = tile_size;
 
-ret = avcodec_decode_video2(ctx->jpeg_avctx, ctx->jpgframe,
-_frame, );
-if (ret < 0 || !got_frame || ctx->jpgframe->format != AV_PIX_FMT_YUVJ420P) 
{
+ret = avcodec_send_packet(ctx->jpeg_avctx, );
+if (ret < 0) {
+av_log(avctx, AV_LOG_ERROR, "Error submitting a packet for 
decoding\n");
+return ret;
+}
+
+ret = avcodec_receive_frame(ctx->jpeg_avctx, ctx->jpgframe);
+if (ret < 0 || ctx->jpgframe->format != AV_PIX_FMT_YUVJ420P) {
 av_log(avctx, AV_LOG_ERROR,
-   "JPEG decoding error (%d) for (%d) frame.\n",
-   ret, got_frame);
+   "JPEG decoding error (%d).\n", ret);
 
 /* Normally skip, error if explode */
 if (avctx->err_recognition & AV_EF_EXPLODE)


==


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


[FFmpeg-cvslog] tdsc: use the new decoding API

2017-03-21 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Thu Sep 22 
08:40:05 2016 +0200| [7bf8db4db61eb09fac00eb665d8ec58de8817da6] | committer: 
Anton Khirnov

tdsc: use the new decoding API

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

 libavcodec/tdsc.c | 15 +--
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/libavcodec/tdsc.c b/libavcodec/tdsc.c
index c70c77f..5b952b3 100644
--- a/libavcodec/tdsc.c
+++ b/libavcodec/tdsc.c
@@ -343,7 +343,6 @@ static int tdsc_decode_jpeg_tile(AVCodecContext *avctx, int 
tile_size,
 {
 TDSCContext *ctx = avctx->priv_data;
 AVPacket jpkt;
-int got_frame = 0;
 int ret;
 
 /* Prepare a packet and send to the MJPEG decoder */
@@ -351,12 +350,16 @@ static int tdsc_decode_jpeg_tile(AVCodecContext *avctx, 
int tile_size,
 jpkt.data = ctx->tilebuffer;
 jpkt.size = tile_size;
 
-ret = avcodec_decode_video2(ctx->jpeg_avctx, ctx->jpgframe,
-_frame, );
-if (ret < 0 || !got_frame || ctx->jpgframe->format != AV_PIX_FMT_YUVJ420P) 
{
+ret = avcodec_send_packet(ctx->jpeg_avctx, );
+if (ret < 0) {
+av_log(avctx, AV_LOG_ERROR, "Error submitting a packet for 
decoding\n");
+return ret;
+}
+
+ret = avcodec_receive_frame(ctx->jpeg_avctx, ctx->jpgframe);
+if (ret < 0 || ctx->jpgframe->format != AV_PIX_FMT_YUVJ420P) {
 av_log(avctx, AV_LOG_ERROR,
-   "JPEG decoding error (%d) for (%d) frame.\n",
-   ret, got_frame);
+   "JPEG decoding error (%d).\n", ret);
 
 /* Normally skip, error if explode */
 if (avctx->err_recognition & AV_EF_EXPLODE)

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


[FFmpeg-cvslog] Merge commit 'de2ae3c1fae5a2eb539b9abd7bc2a9ca8c286ff0'

2017-03-21 Thread Clément Bœsch
ffmpeg | branch: master | Clément Bœsch  | Tue Mar 21 13:09:26 
2017 +0100| [ad98af27f7100a80fd5ff934ddc7e9aca94f0496] | committer: Clément 
Bœsch

Merge commit 'de2ae3c1fae5a2eb539b9abd7bc2a9ca8c286ff0'

* commit 'de2ae3c1fae5a2eb539b9abd7bc2a9ca8c286ff0':
  lavc: add clobber tests for the new encoding/decoding API

The merge only re-order what we already have.

Merged-by: Clément Bœsch 

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

 configure | 10 +-
 libavcodec/aarch64/neontest.c |  8 
 libavcodec/arm/neontest.c |  8 
 libavcodec/x86/w64xmmtest.c   |  8 
 4 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/configure b/configure
index a9ea698..487a4d7 100755
--- a/configure
+++ b/configure
@@ -6152,11 +6152,11 @@ enabled neon_clobber_test &&
   -Wl,--wrap,avcodec_decode_subtitle2   \
   -Wl,--wrap,avcodec_encode_audio2  \
   -Wl,--wrap,avcodec_encode_video2  \
+  -Wl,--wrap,avcodec_encode_subtitle\
   -Wl,--wrap,avcodec_send_packet\
-  -Wl,--wrap,avcodec_receive_frame  \
-  -Wl,--wrap,avcodec_send_frame \
   -Wl,--wrap,avcodec_receive_packet \
-  -Wl,--wrap,avcodec_encode_subtitle\
+  -Wl,--wrap,avcodec_send_frame \
+  -Wl,--wrap,avcodec_receive_frame  \
   -Wl,--wrap,swr_convert\
   -Wl,--wrap,avresample_convert ||
 disable neon_clobber_test
@@ -6170,9 +6170,9 @@ enabled xmm_clobber_test &&
   -Wl,--wrap,avcodec_encode_video2  \
   -Wl,--wrap,avcodec_encode_subtitle\
   -Wl,--wrap,avcodec_send_packet\
-  -Wl,--wrap,avcodec_receive_frame  \
-  -Wl,--wrap,avcodec_send_frame \
   -Wl,--wrap,avcodec_receive_packet \
+  -Wl,--wrap,avcodec_send_frame \
+  -Wl,--wrap,avcodec_receive_frame  \
   -Wl,--wrap,swr_convert\
   -Wl,--wrap,avresample_convert \
   -Wl,--wrap,sws_scale ||
diff --git a/libavcodec/aarch64/neontest.c b/libavcodec/aarch64/neontest.c
index 1e9ef16..a24c22d 100644
--- a/libavcodec/aarch64/neontest.c
+++ b/libavcodec/aarch64/neontest.c
@@ -83,9 +83,9 @@ wrap(avcodec_send_packet(AVCodecContext *avctx, const 
AVPacket *avpkt))
 testneonclobbers(avcodec_send_packet, avctx, avpkt);
 }
 
-wrap(avcodec_receive_frame(AVCodecContext *avctx, AVFrame *frame))
+wrap(avcodec_receive_packet(AVCodecContext *avctx, AVPacket *avpkt))
 {
-testneonclobbers(avcodec_receive_frame, avctx, frame);
+testneonclobbers(avcodec_receive_packet, avctx, avpkt);
 }
 
 wrap(avcodec_send_frame(AVCodecContext *avctx, const AVFrame *frame))
@@ -93,7 +93,7 @@ wrap(avcodec_send_frame(AVCodecContext *avctx, const AVFrame 
*frame))
 testneonclobbers(avcodec_send_frame, avctx, frame);
 }
 
-wrap(avcodec_receive_packet(AVCodecContext *avctx, AVPacket *avpkt))
+wrap(avcodec_receive_frame(AVCodecContext *avctx, AVFrame *frame))
 {
-testneonclobbers(avcodec_receive_packet, avctx, avpkt);
+testneonclobbers(avcodec_receive_frame, avctx, frame);
 }
diff --git a/libavcodec/arm/neontest.c b/libavcodec/arm/neontest.c
index 56f950a..f9c0dbf 100644
--- a/libavcodec/arm/neontest.c
+++ b/libavcodec/arm/neontest.c
@@ -83,9 +83,9 @@ wrap(avcodec_send_packet(AVCodecContext *avctx, const 
AVPacket *avpkt))
 testneonclobbers(avcodec_send_packet, avctx, avpkt);
 }
 
-wrap(avcodec_receive_frame(AVCodecContext *avctx, AVFrame *frame))
+wrap(avcodec_receive_packet(AVCodecContext *avctx, AVPacket *avpkt))
 {
-testneonclobbers(avcodec_receive_frame, avctx, frame);
+testneonclobbers(avcodec_receive_packet, avctx, avpkt);
 }
 
 wrap(avcodec_send_frame(AVCodecContext *avctx, const AVFrame *frame))
@@ -93,7 +93,7 @@ wrap(avcodec_send_frame(AVCodecContext *avctx, const AVFrame 
*frame))
 testneonclobbers(avcodec_send_frame, avctx, frame);
 }
 
-wrap(avcodec_receive_packet(AVCodecContext *avctx, AVPacket *avpkt))
+wrap(avcodec_receive_frame(AVCodecContext *avctx, AVFrame *frame))
 {
-testneonclobbers(avcodec_receive_packet, avctx, avpkt);
+testneonclobbers(avcodec_receive_frame, avctx, frame);
 }
diff --git a/libavcodec/x86/w64xmmtest.c b/libavcodec/x86/w64xmmtest.c
index 987fa51..8f2b8a6 100644
--- a/libavcodec/x86/w64xmmtest.c
+++ b/libavcodec/x86/w64xmmtest.c
@@ -83,9 +83,9 @@ wrap(avcodec_send_packet(AVCodecContext *avctx, const 
AVPacket *avpkt))
 testxmmclobbers(avcodec_send_packet, avctx, avpkt);
 }
 
-wrap(avcodec_receive_frame(AVCodecContext *avctx, AVFrame *frame))
+wrap(avcodec_receive_packet(AVCodecContext *avctx, AVPacket *avpkt))
 

[FFmpeg-cvslog] lavc: add clobber tests for the new encoding/decoding API

2017-03-21 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Wed Sep 21 
20:44:36 2016 +0200| [de2ae3c1fae5a2eb539b9abd7bc2a9ca8c286ff0] | committer: 
Anton Khirnov

lavc: add clobber tests for the new encoding/decoding API

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

 configure |  8 
 libavcodec/aarch64/neontest.c | 20 
 libavcodec/arm/neontest.c | 20 
 libavcodec/x86/w64xmmtest.c   | 20 
 4 files changed, 68 insertions(+)

diff --git a/configure b/configure
index 1f5fb8a..3c416da 100755
--- a/configure
+++ b/configure
@@ -4831,6 +4831,10 @@ enabled neon_clobber_test &&
   -Wl,--wrap,avcodec_encode_audio2  \
   -Wl,--wrap,avcodec_encode_video2  \
   -Wl,--wrap,avcodec_encode_subtitle\
+  -Wl,--wrap,avcodec_send_packet\
+  -Wl,--wrap,avcodec_receive_packet \
+  -Wl,--wrap,avcodec_send_frame \
+  -Wl,--wrap,avcodec_receive_frame  \
   -Wl,--wrap,avresample_convert ||
 disable neon_clobber_test
 
@@ -4842,6 +4846,10 @@ enabled xmm_clobber_test &&
   -Wl,--wrap,avcodec_encode_audio2  \
   -Wl,--wrap,avcodec_encode_video2  \
   -Wl,--wrap,avcodec_encode_subtitle\
+  -Wl,--wrap,avcodec_send_packet\
+  -Wl,--wrap,avcodec_receive_packet \
+  -Wl,--wrap,avcodec_send_frame \
+  -Wl,--wrap,avcodec_receive_frame  \
   -Wl,--wrap,avresample_convert \
   -Wl,--wrap,sws_scale ||
 disable xmm_clobber_test
diff --git a/libavcodec/aarch64/neontest.c b/libavcodec/aarch64/neontest.c
index 137c8e6..201bfb1 100644
--- a/libavcodec/aarch64/neontest.c
+++ b/libavcodec/aarch64/neontest.c
@@ -77,3 +77,23 @@ wrap(avcodec_encode_video2(AVCodecContext *avctx, AVPacket 
*avpkt,
 {
 testneonclobbers(avcodec_encode_video2, avctx, avpkt, frame, 
got_packet_ptr);
 }
+
+wrap(avcodec_send_packet(AVCodecContext *avctx, const AVPacket *avpkt))
+{
+testneonclobbers(avcodec_send_packet, avctx, avpkt);
+}
+
+wrap(avcodec_receive_packet(AVCodecContext *avctx, AVPacket *avpkt))
+{
+testneonclobbers(avcodec_receive_packet, avctx, avpkt);
+}
+
+wrap(avcodec_send_frame(AVCodecContext *avctx, const AVFrame *frame))
+{
+testneonclobbers(avcodec_send_frame, avctx, frame);
+}
+
+wrap(avcodec_receive_frame(AVCodecContext *avctx, AVFrame *frame))
+{
+testneonclobbers(avcodec_receive_frame, avctx, frame);
+}
diff --git a/libavcodec/arm/neontest.c b/libavcodec/arm/neontest.c
index 692576e..67d7747 100644
--- a/libavcodec/arm/neontest.c
+++ b/libavcodec/arm/neontest.c
@@ -77,3 +77,23 @@ wrap(avcodec_encode_video2(AVCodecContext *avctx, AVPacket 
*avpkt,
 {
 testneonclobbers(avcodec_encode_video2, avctx, avpkt, frame, 
got_packet_ptr);
 }
+
+wrap(avcodec_send_packet(AVCodecContext *avctx, const AVPacket *avpkt))
+{
+testneonclobbers(avcodec_send_packet, avctx, avpkt);
+}
+
+wrap(avcodec_receive_packet(AVCodecContext *avctx, AVPacket *avpkt))
+{
+testneonclobbers(avcodec_receive_packet, avctx, avpkt);
+}
+
+wrap(avcodec_send_frame(AVCodecContext *avctx, const AVFrame *frame))
+{
+testneonclobbers(avcodec_send_frame, avctx, frame);
+}
+
+wrap(avcodec_receive_frame(AVCodecContext *avctx, AVFrame *frame))
+{
+testneonclobbers(avcodec_receive_frame, avctx, frame);
+}
diff --git a/libavcodec/x86/w64xmmtest.c b/libavcodec/x86/w64xmmtest.c
index 400dc4d..8925573 100644
--- a/libavcodec/x86/w64xmmtest.c
+++ b/libavcodec/x86/w64xmmtest.c
@@ -77,3 +77,23 @@ wrap(avcodec_encode_video2(AVCodecContext *avctx, AVPacket 
*avpkt,
 {
 testxmmclobbers(avcodec_encode_video2, avctx, avpkt, frame, 
got_packet_ptr);
 }
+
+wrap(avcodec_send_packet(AVCodecContext *avctx, const AVPacket *avpkt))
+{
+testxmmclobbers(avcodec_send_packet, avctx, avpkt);
+}
+
+wrap(avcodec_receive_packet(AVCodecContext *avctx, AVPacket *avpkt))
+{
+testxmmclobbers(avcodec_receive_packet, avctx, avpkt);
+}
+
+wrap(avcodec_send_frame(AVCodecContext *avctx, const AVFrame *frame))
+{
+testxmmclobbers(avcodec_send_frame, avctx, frame);
+}
+
+wrap(avcodec_receive_frame(AVCodecContext *avctx, AVFrame *frame))
+{
+testxmmclobbers(avcodec_receive_frame, avctx, frame);
+}

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


[FFmpeg-cvslog] vf_drawtext: Fix memory leak

2017-03-21 Thread Kieran Kunhya
ffmpeg | branch: master | Kieran Kunhya  | Mon Mar 20 19:40:29 
2017 +| [4cca2f74f25331067cfb234328411bd114664871] | committer: Kieran 
Kunhya

vf_drawtext: Fix memory leak

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

 libavfilter/vf_drawtext.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
index 0b94725..bcbe2d9 100644
--- a/libavfilter/vf_drawtext.c
+++ b/libavfilter/vf_drawtext.c
@@ -709,7 +709,8 @@ static av_cold void uninit(AVFilterContext *ctx)
 
 av_expr_free(s->x_pexpr);
 av_expr_free(s->y_pexpr);
-s->x_pexpr = s->y_pexpr = NULL;
+av_expr_free(s->a_pexpr);
+s->x_pexpr = s->y_pexpr = s->a_pexpr = NULL;
 av_freep(>positions);
 s->nb_positions = 0;
 
@@ -752,7 +753,8 @@ static int config_input(AVFilterLink *inlink)
 
 av_expr_free(s->x_pexpr);
 av_expr_free(s->y_pexpr);
-s->x_pexpr = s->y_pexpr = NULL;
+av_expr_free(s->a_pexpr);
+s->x_pexpr = s->y_pexpr = s->a_pexpr = NULL;
 
 if ((ret = av_expr_parse(>x_pexpr, s->x_expr, var_names,
  NULL, NULL, fun2_names, fun2, 0, ctx)) < 0 ||

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


[FFmpeg-cvslog] Merge commit '68811a41c70f019bde6df2a4f289674228c48958'

2017-03-21 Thread Clément Bœsch
ffmpeg | branch: master | Clément Bœsch  | Tue Mar 21 13:01:46 
2017 +0100| [e6be531a30b7f1a14f207e02fb3996e5ae957f0d] | committer: Clément 
Bœsch

Merge commit '68811a41c70f019bde6df2a4f289674228c48958'

* commit '68811a41c70f019bde6df2a4f289674228c48958':
  mpegvideo_enc: use the new encoding API for b_strategy=2

Merged-by: Clément Bœsch 

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

 libavcodec/mpegvideo_enc.c | 88 ++
 1 file changed, 49 insertions(+), 39 deletions(-)

diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 9749554..71a858f 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -1433,30 +1433,38 @@ static int skip_check(MpegEncContext *s, Picture *p, 
Picture *ref)
 static int encode_frame(AVCodecContext *c, AVFrame *frame)
 {
 AVPacket pkt = { 0 };
-int ret, got_output;
+int ret;
+int size = 0;
 
 av_init_packet();
-ret = avcodec_encode_video2(c, , frame, _output);
+
+ret = avcodec_send_frame(c, frame);
 if (ret < 0)
 return ret;
 
-ret = pkt.size;
-av_packet_unref();
-return ret;
+do {
+ret = avcodec_receive_packet(c, );
+if (ret >= 0) {
+size += pkt.size;
+av_packet_unref();
+} else if (ret < 0 && ret != AVERROR(EAGAIN) && ret != AVERROR_EOF)
+return ret;
+} while (ret >= 0);
+
+return size;
 }
 
 static int estimate_best_b_count(MpegEncContext *s)
 {
 const AVCodec *codec = avcodec_find_encoder(s->avctx->codec_id);
-AVCodecContext *c = avcodec_alloc_context3(NULL);
 const int scale = s->brd_scale;
+int width  = s->width  >> scale;
+int height = s->height >> scale;
 int i, j, out_size, p_lambda, b_lambda, lambda2;
 int64_t best_rd  = INT64_MAX;
 int best_b_count = -1;
 int ret = 0;
 
-if (!c)
-return AVERROR(ENOMEM);
 av_assert0(scale >= 0 && scale <= 3);
 
 //emms_c();
@@ -1469,21 +1477,6 @@ static int estimate_best_b_count(MpegEncContext *s)
 lambda2  = (b_lambda * b_lambda + (1 << FF_LAMBDA_SHIFT) / 2) >>
FF_LAMBDA_SHIFT;
 
-c->width= s->width  >> scale;
-c->height   = s->height >> scale;
-c->flags= AV_CODEC_FLAG_QSCALE | AV_CODEC_FLAG_PSNR;
-c->flags   |= s->avctx->flags & AV_CODEC_FLAG_QPEL;
-c->mb_decision  = s->avctx->mb_decision;
-c->me_cmp   = s->avctx->me_cmp;
-c->mb_cmp   = s->avctx->mb_cmp;
-c->me_sub_cmp   = s->avctx->me_sub_cmp;
-c->pix_fmt  = AV_PIX_FMT_YUV420P;
-c->time_base= s->avctx->time_base;
-c->max_b_frames = s->max_b_frames;
-
-if (avcodec_open2(c, codec, NULL) < 0)
-return -1;
-
 for (i = 0; i < s->max_b_frames + 2; i++) {
 Picture pre_input, *pre_input_ptr = i ? s->input_picture[i - 1] :
 s->next_picture_ptr;
@@ -1503,27 +1496,46 @@ static int estimate_best_b_count(MpegEncContext *s)
s->tmp_frames[i]->linesize[0],
data[0],
pre_input.f->linesize[0],
-   c->width, c->height);
+   width, height);
 s->mpvencdsp.shrink[scale](s->tmp_frames[i]->data[1],
s->tmp_frames[i]->linesize[1],
data[1],
pre_input.f->linesize[1],
-   c->width >> 1, c->height >> 1);
+   width >> 1, height >> 1);
 s->mpvencdsp.shrink[scale](s->tmp_frames[i]->data[2],
s->tmp_frames[i]->linesize[2],
data[2],
pre_input.f->linesize[2],
-   c->width >> 1, c->height >> 1);
+   width >> 1, height >> 1);
 }
 }
 
 for (j = 0; j < s->max_b_frames + 1; j++) {
+AVCodecContext *c;
 int64_t rd = 0;
 
 if (!s->input_picture[j])
 break;
 
-c->error[0] = c->error[1] = c->error[2] = 0;
+c = avcodec_alloc_context3(NULL);
+if (!c)
+return AVERROR(ENOMEM);
+
+c->width= width;
+c->height   = height;
+c->flags= AV_CODEC_FLAG_QSCALE | AV_CODEC_FLAG_PSNR;
+c->flags   |= s->avctx->flags & AV_CODEC_FLAG_QPEL;
+c->mb_decision  = s->avctx->mb_decision;
+c->me_cmp   = s->avctx->me_cmp;
+c->mb_cmp   = s->avctx->mb_cmp;
+c->me_sub_cmp   = s->avctx->me_sub_cmp;
+c->pix_fmt  = AV_PIX_FMT_YUV420P;
+c->time_base= 

[FFmpeg-cvslog] mpegvideo_enc: use the new encoding API for b_strategy=2

2017-03-21 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Wed Sep 21 
20:22:14 2016 +0200| [68811a41c70f019bde6df2a4f289674228c48958] | committer: 
Anton Khirnov

mpegvideo_enc: use the new encoding API for b_strategy=2

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

 libavcodec/mpegvideo_enc.c | 88 ++
 1 file changed, 49 insertions(+), 39 deletions(-)

diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 6ab9ba5..6a7c9e5 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -1245,30 +1245,38 @@ static int skip_check(MpegEncContext *s, Picture *p, 
Picture *ref)
 static int encode_frame(AVCodecContext *c, AVFrame *frame)
 {
 AVPacket pkt = { 0 };
-int ret, got_output;
+int ret;
+int size = 0;
 
 av_init_packet();
-ret = avcodec_encode_video2(c, , frame, _output);
+
+ret = avcodec_send_frame(c, frame);
 if (ret < 0)
 return ret;
 
-ret = pkt.size;
-av_packet_unref();
-return ret;
+do {
+ret = avcodec_receive_packet(c, );
+if (ret >= 0) {
+size += pkt.size;
+av_packet_unref();
+} else if (ret < 0 && ret != AVERROR(EAGAIN) && ret != AVERROR_EOF)
+return ret;
+} while (ret >= 0);
+
+return size;
 }
 
 static int estimate_best_b_count(MpegEncContext *s)
 {
 const AVCodec *codec = avcodec_find_encoder(s->avctx->codec_id);
-AVCodecContext *c = avcodec_alloc_context3(NULL);
 const int scale = s->brd_scale;
+int width  = s->width  >> scale;
+int height = s->height >> scale;
 int i, j, out_size, p_lambda, b_lambda, lambda2;
 int64_t best_rd  = INT64_MAX;
 int best_b_count = -1;
 int ret = 0;
 
-if (!c)
-return AVERROR(ENOMEM);
 assert(scale >= 0 && scale <= 3);
 
 //emms_c();
@@ -1281,21 +1289,6 @@ static int estimate_best_b_count(MpegEncContext *s)
 lambda2  = (b_lambda * b_lambda + (1 << FF_LAMBDA_SHIFT) / 2) >>
FF_LAMBDA_SHIFT;
 
-c->width= s->width  >> scale;
-c->height   = s->height >> scale;
-c->flags= AV_CODEC_FLAG_QSCALE | AV_CODEC_FLAG_PSNR;
-c->flags   |= s->avctx->flags & AV_CODEC_FLAG_QPEL;
-c->mb_decision  = s->avctx->mb_decision;
-c->me_cmp   = s->avctx->me_cmp;
-c->mb_cmp   = s->avctx->mb_cmp;
-c->me_sub_cmp   = s->avctx->me_sub_cmp;
-c->pix_fmt  = AV_PIX_FMT_YUV420P;
-c->time_base= s->avctx->time_base;
-c->max_b_frames = s->max_b_frames;
-
-if (avcodec_open2(c, codec, NULL) < 0)
-return -1;
-
 for (i = 0; i < s->max_b_frames + 2; i++) {
 Picture pre_input, *pre_input_ptr = i ? s->input_picture[i - 1] :
 s->next_picture_ptr;
@@ -1313,27 +1306,46 @@ static int estimate_best_b_count(MpegEncContext *s)
s->tmp_frames[i]->linesize[0],
pre_input.f->data[0],
pre_input.f->linesize[0],
-   c->width, c->height);
+   width, height);
 s->mpvencdsp.shrink[scale](s->tmp_frames[i]->data[1],
s->tmp_frames[i]->linesize[1],
pre_input.f->data[1],
pre_input.f->linesize[1],
-   c->width >> 1, c->height >> 1);
+   width >> 1, height >> 1);
 s->mpvencdsp.shrink[scale](s->tmp_frames[i]->data[2],
s->tmp_frames[i]->linesize[2],
pre_input.f->data[2],
pre_input.f->linesize[2],
-   c->width >> 1, c->height >> 1);
+   width >> 1, height >> 1);
 }
 }
 
 for (j = 0; j < s->max_b_frames + 1; j++) {
+AVCodecContext *c;
 int64_t rd = 0;
 
 if (!s->input_picture[j])
 break;
 
-c->error[0] = c->error[1] = c->error[2] = 0;
+c = avcodec_alloc_context3(NULL);
+if (!c)
+return AVERROR(ENOMEM);
+
+c->width= width;
+c->height   = height;
+c->flags= AV_CODEC_FLAG_QSCALE | AV_CODEC_FLAG_PSNR;
+c->flags   |= s->avctx->flags & AV_CODEC_FLAG_QPEL;
+c->mb_decision  = s->avctx->mb_decision;
+c->me_cmp   = s->avctx->me_cmp;
+c->mb_cmp   = s->avctx->mb_cmp;
+c->me_sub_cmp   = s->avctx->me_sub_cmp;
+c->pix_fmt  = AV_PIX_FMT_YUV420P;
+c->time_base= s->avctx->time_base;
+c->max_b_frames = s->max_b_frames;
+
+ret = avcodec_open2(c, codec, NULL);
+

[FFmpeg-cvslog] mpegvideo_enc: handle encoding errors with b_strategy=2

2017-03-21 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Wed Sep 21 
20:21:58 2016 +0200| [f03f78bc1c99b1e29624418e2f7315b8a47981e9] | committer: 
Anton Khirnov

mpegvideo_enc: handle encoding errors with b_strategy=2

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

 libavcodec/mpegvideo_enc.c | 18 ++
 1 file changed, 18 insertions(+)

diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 46e2e2c..6ab9ba5 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -1265,6 +1265,7 @@ static int estimate_best_b_count(MpegEncContext *s)
 int i, j, out_size, p_lambda, b_lambda, lambda2;
 int64_t best_rd  = INT64_MAX;
 int best_b_count = -1;
+int ret = 0;
 
 if (!c)
 return AVERROR(ENOMEM);
@@ -1338,6 +1339,10 @@ static int estimate_best_b_count(MpegEncContext *s)
 s->tmp_frames[0]->quality   = 1 * FF_QP2LAMBDA;
 
 out_size = encode_frame(c, s->tmp_frames[0]);
+if (out_size < 0) {
+ret = out_size;
+goto fail;
+}
 
 //rd += (out_size * lambda2) >> FF_LAMBDA_SHIFT;
 
@@ -1349,6 +1354,10 @@ static int estimate_best_b_count(MpegEncContext *s)
 s->tmp_frames[i + 1]->quality   = is_p ? p_lambda : b_lambda;
 
 out_size = encode_frame(c, s->tmp_frames[i + 1]);
+if (out_size < 0) {
+ret = out_size;
+goto fail;
+}
 
 rd += (out_size * lambda2) >> (FF_LAMBDA_SHIFT - 3);
 }
@@ -1356,6 +1365,10 @@ static int estimate_best_b_count(MpegEncContext *s)
 /* get the delayed frames */
 while (out_size) {
 out_size = encode_frame(c, NULL);
+if (out_size < 0) {
+ret = out_size;
+goto fail;
+}
 rd += (out_size * lambda2) >> (FF_LAMBDA_SHIFT - 3);
 }
 
@@ -1370,6 +1383,9 @@ static int estimate_best_b_count(MpegEncContext *s)
 avcodec_free_context();
 
 return best_b_count;
+fail:
+avcodec_free_context();
+return ret;
 }
 
 static int select_input_picture(MpegEncContext *s)
@@ -1450,6 +1466,8 @@ static int select_input_picture(MpegEncContext *s)
 }
 } else if (s->b_frame_strategy == 2) {
 b_frames = estimate_best_b_count(s);
+if (b_frames < 0)
+return b_frames;
 }
 
 emms_c();

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


[FFmpeg-cvslog] Merge commit 'f03f78bc1c99b1e29624418e2f7315b8a47981e9'

2017-03-21 Thread Clément Bœsch
ffmpeg | branch: master | Clément Bœsch  | Tue Mar 21 12:57:02 
2017 +0100| [b2cb9191eaf240649be0b0716b897a96cea7879c] | committer: Clément 
Bœsch

Merge commit 'f03f78bc1c99b1e29624418e2f7315b8a47981e9'

* commit 'f03f78bc1c99b1e29624418e2f7315b8a47981e9':
  mpegvideo_enc: handle encoding errors with b_strategy=2

Merged-by: Clément Bœsch 

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

 libavcodec/mpegvideo_enc.c | 18 ++
 1 file changed, 18 insertions(+)

diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 8051605..9749554 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -1453,6 +1453,7 @@ static int estimate_best_b_count(MpegEncContext *s)
 int i, j, out_size, p_lambda, b_lambda, lambda2;
 int64_t best_rd  = INT64_MAX;
 int best_b_count = -1;
+int ret = 0;
 
 if (!c)
 return AVERROR(ENOMEM);
@@ -1528,6 +1529,10 @@ static int estimate_best_b_count(MpegEncContext *s)
 s->tmp_frames[0]->quality   = 1 * FF_QP2LAMBDA;
 
 out_size = encode_frame(c, s->tmp_frames[0]);
+if (out_size < 0) {
+ret = out_size;
+goto fail;
+}
 
 //rd += (out_size * lambda2) >> FF_LAMBDA_SHIFT;
 
@@ -1539,6 +1544,10 @@ static int estimate_best_b_count(MpegEncContext *s)
 s->tmp_frames[i + 1]->quality   = is_p ? p_lambda : b_lambda;
 
 out_size = encode_frame(c, s->tmp_frames[i + 1]);
+if (out_size < 0) {
+ret = out_size;
+goto fail;
+}
 
 rd += (out_size * lambda2) >> (FF_LAMBDA_SHIFT - 3);
 }
@@ -1546,6 +1555,10 @@ static int estimate_best_b_count(MpegEncContext *s)
 /* get the delayed frames */
 while (out_size) {
 out_size = encode_frame(c, NULL);
+if (out_size < 0) {
+ret = out_size;
+goto fail;
+}
 rd += (out_size * lambda2) >> (FF_LAMBDA_SHIFT - 3);
 }
 
@@ -1560,6 +1573,9 @@ static int estimate_best_b_count(MpegEncContext *s)
 avcodec_free_context();
 
 return best_b_count;
+fail:
+avcodec_free_context();
+return ret;
 }
 
 static int select_input_picture(MpegEncContext *s)
@@ -1640,6 +1656,8 @@ static int select_input_picture(MpegEncContext *s)
 }
 } else if (s->b_frame_strategy == 2) {
 b_frames = estimate_best_b_count(s);
+if (b_frames < 0)
+return b_frames;
 }
 
 emms_c();


==


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


[FFmpeg-cvslog] mpegvideo_enc: add const to the AVCodec instance

2017-03-21 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Wed Sep 21 
20:06:11 2016 +0200| [6f733ecab6faff2a16534f2ce7d2ffd41c07846b] | committer: 
Anton Khirnov

mpegvideo_enc: add const to the AVCodec instance

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

 libavcodec/mpegvideo_enc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index d738d06..46e2e2c 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -1259,7 +1259,7 @@ static int encode_frame(AVCodecContext *c, AVFrame *frame)
 
 static int estimate_best_b_count(MpegEncContext *s)
 {
-AVCodec *codec= avcodec_find_encoder(s->avctx->codec_id);
+const AVCodec *codec = avcodec_find_encoder(s->avctx->codec_id);
 AVCodecContext *c = avcodec_alloc_context3(NULL);
 const int scale = s->brd_scale;
 int i, j, out_size, p_lambda, b_lambda, lambda2;

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


[FFmpeg-cvslog] Merge commit '6f733ecab6faff2a16534f2ce7d2ffd41c07846b'

2017-03-21 Thread Clément Bœsch
ffmpeg | branch: master | Clément Bœsch  | Tue Mar 21 12:55:40 
2017 +0100| [70ca9b76e2afb6dc89e0ffdb2753237ed5290009] | committer: Clément 
Bœsch

Merge commit '6f733ecab6faff2a16534f2ce7d2ffd41c07846b'

* commit '6f733ecab6faff2a16534f2ce7d2ffd41c07846b':
  mpegvideo_enc: add const to the AVCodec instance

Merged-by: Clément Bœsch 

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

 libavcodec/mpegvideo_enc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 0e4cbe8..8051605 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -1447,7 +1447,7 @@ static int encode_frame(AVCodecContext *c, AVFrame *frame)
 
 static int estimate_best_b_count(MpegEncContext *s)
 {
-AVCodec *codec= avcodec_find_encoder(s->avctx->codec_id);
+const AVCodec *codec = avcodec_find_encoder(s->avctx->codec_id);
 AVCodecContext *c = avcodec_alloc_context3(NULL);
 const int scale = s->brd_scale;
 int i, j, out_size, p_lambda, b_lambda, lambda2;


==


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


[FFmpeg-cvslog] Merge commit '6c09af7e46a5a1ada67ffe832f7895cf2749130b'

2017-03-21 Thread Clément Bœsch
ffmpeg | branch: master | Clément Bœsch  | Tue Mar 21 12:52:54 
2017 +0100| [81dc9b77a7577eef1a5da4ff1df9c85a96cbba54] | committer: Clément 
Bœsch

Merge commit '6c09af7e46a5a1ada67ffe832f7895cf2749130b'

* commit '6c09af7e46a5a1ada67ffe832f7895cf2749130b':
  APIchanges: fix a typo in the version number

This commit is a noop (typo is not present in FFmpeg).

Merged-by: Clément Bœsch 

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



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


[FFmpeg-cvslog] APIchanges: fix a typo in the version number

2017-03-21 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Tue Sep 27 
15:47:22 2016 +0200| [6c09af7e46a5a1ada67ffe832f7895cf2749130b] | committer: 
Anton Khirnov

APIchanges: fix a typo in the version number

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

 doc/APIchanges | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 6859081..d0ffca2 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -16,7 +16,7 @@ API changes, most recent first:
 2016-xx-xx - xxx - lavu 55.22.0 - pixfmt.h
   Add AV_PIX_FMT_YUV(420,422,444)P12.
 
-2016-xx-xx - xxx - lavc 59.27.0 - avcodec.h
+2016-xx-xx - xxx - lavc 57.27.0 - avcodec.h
   Add FF_PROFILE_HEVC_REXT, the extended pixel format profile for HEVC.
 
 2016-08-24 - xxx - lavu 55.21.0 - imgutils.h

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


[FFmpeg-cvslog] pixfmt: Add yuv444p12 pixel format

2017-03-21 Thread Luca Barbato
ffmpeg | branch: master | Luca Barbato  | Sat Sep 24 
23:09:43 2016 +0200| [9bd6ea5695660529b2887292874a7b9e61fc301e] | committer: 
Luca Barbato

pixfmt: Add yuv444p12 pixel format

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

 libavutil/pixdesc.c   | 25 +
 libavutil/pixfmt.h|  4 
 libswscale/swscale_unscaled.c |  4 +++-
 libswscale/utils.c|  2 ++
 tests/ref/fate/filter-pixdesc-yuv444p12be |  1 +
 tests/ref/fate/filter-pixdesc-yuv444p12le |  1 +
 tests/ref/fate/filter-pixfmts-copy|  2 ++
 tests/ref/fate/filter-pixfmts-null|  2 ++
 tests/ref/fate/filter-pixfmts-scale   |  2 ++
 tests/ref/fate/filter-pixfmts-vflip   |  2 ++
 10 files changed, 44 insertions(+), 1 deletion(-)

diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index e0c7851..78fbdbc 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -1342,6 +1342,30 @@ static const AVPixFmtDescriptor 
av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
 },
 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
 },
+[AV_PIX_FMT_YUV444P12LE] = {
+.name = "yuv444p12le",
+.nb_components = 3,
+.log2_chroma_w = 0,
+.log2_chroma_h = 0,
+.comp = {
+{ 0, 2, 0, 0, 12, 1, 11, 1 },/* Y */
+{ 1, 2, 0, 0, 12, 1, 11, 1 },/* U */
+{ 2, 2, 0, 0, 12, 1, 11, 1 },/* V */
+},
+.flags = AV_PIX_FMT_FLAG_PLANAR,
+},
+[AV_PIX_FMT_YUV444P12BE] = {
+.name = "yuv444p12be",
+.nb_components = 3,
+.log2_chroma_w = 0,
+.log2_chroma_h = 0,
+.comp = {
+{ 0, 2, 0, 0, 12, 1, 11, 1 },/* Y */
+{ 1, 2, 0, 0, 12, 1, 11, 1 },/* U */
+{ 2, 2, 0, 0, 12, 1, 11, 1 },/* V */
+},
+.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
+},
 [AV_PIX_FMT_YUV444P10LE] = {
 .name = "yuv444p10le",
 .nb_components = 3,
@@ -1892,6 +1916,7 @@ enum AVPixelFormat av_pix_fmt_swap_endianness(enum 
AVPixelFormat pix_fmt)
 PIX_FMT_SWAP_ENDIANNESS(YUV444P10);
 PIX_FMT_SWAP_ENDIANNESS(YUV420P12);
 PIX_FMT_SWAP_ENDIANNESS(YUV422P12);
+PIX_FMT_SWAP_ENDIANNESS(YUV444P12);
 PIX_FMT_SWAP_ENDIANNESS(YUV420P16);
 PIX_FMT_SWAP_ENDIANNESS(YUV422P16);
 PIX_FMT_SWAP_ENDIANNESS(YUV444P16);
diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
index 3e356af..908b0fe 100644
--- a/libavutil/pixfmt.h
+++ b/libavutil/pixfmt.h
@@ -236,6 +236,9 @@ enum AVPixelFormat {
 AV_PIX_FMT_YUV422P12BE, ///< planar YUV 4:2:2, 24bpp, (1 Cr & Cb sample 
per 2x1 Y samples), big-endian
 AV_PIX_FMT_YUV422P12LE, ///< planar YUV 4:2:2, 24bpp, (1 Cr & Cb sample 
per 2x1 Y samples), little-endian
 
+AV_PIX_FMT_YUV444P12BE, ///< planar YUV 4:4:4, 36bpp, (1 Cr & Cb sample 
per 1x1 Y), big-endian
+AV_PIX_FMT_YUV444P12LE, ///< planar YUV 4:4:4, 36bpp, (1 Cr & Cb sample 
per 1x1 Y), little-endian
+
 AV_PIX_FMT_NB,///< number of pixel formats, DO NOT USE THIS if you 
want to link with shared libav* because the number of formats might differ 
between versions
 };
 
@@ -271,6 +274,7 @@ enum AVPixelFormat {
 #define AV_PIX_FMT_YUV444P10 AV_PIX_FMT_NE(YUV444P10BE, YUV444P10LE)
 #define AV_PIX_FMT_YUV420P12 AV_PIX_FMT_NE(YUV420P12BE, YUV420P12LE)
 #define AV_PIX_FMT_YUV422P12 AV_PIX_FMT_NE(YUV422P12BE, YUV422P12LE)
+#define AV_PIX_FMT_YUV444P12 AV_PIX_FMT_NE(YUV444P12BE, YUV444P12LE)
 #define AV_PIX_FMT_YUV420P16 AV_PIX_FMT_NE(YUV420P16BE, YUV420P16LE)
 #define AV_PIX_FMT_YUV422P16 AV_PIX_FMT_NE(YUV422P16BE, YUV422P16LE)
 #define AV_PIX_FMT_YUV444P16 AV_PIX_FMT_NE(YUV444P16BE, YUV444P16LE)
diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c
index 31706ca..ad87bbc 100644
--- a/libswscale/swscale_unscaled.c
+++ b/libswscale/swscale_unscaled.c
@@ -1159,10 +1159,12 @@ void ff_get_unscaled_swscale(SwsContext *c)
  dstFormat != AV_PIX_FMT_P010LE && dstFormat != AV_PIX_FMT_P010BE &&
  dstFormat != AV_PIX_FMT_YUV420P12LE && dstFormat != 
AV_PIX_FMT_YUV420P12BE &&
  dstFormat != AV_PIX_FMT_YUV422P12LE && dstFormat != 
AV_PIX_FMT_YUV422P12BE &&
+ dstFormat != AV_PIX_FMT_YUV444P12LE && dstFormat != 
AV_PIX_FMT_YUV444P12BE &&
  srcFormat != AV_PIX_FMT_NV12 && srcFormat != AV_PIX_FMT_NV21 &&
  srcFormat != AV_PIX_FMT_P010LE && srcFormat != AV_PIX_FMT_P010BE &&
  srcFormat != AV_PIX_FMT_YUV420P12LE && srcFormat != 
AV_PIX_FMT_YUV420P12BE &&
- srcFormat != AV_PIX_FMT_YUV422P12LE && srcFormat != 
AV_PIX_FMT_YUV422P12BE))
+ srcFormat != AV_PIX_FMT_YUV422P12LE && srcFormat != 
AV_PIX_FMT_YUV422P12BE &&
+ srcFormat != AV_PIX_FMT_YUV444P12LE && srcFormat != 
AV_PIX_FMT_YUV444P12BE))
 {
 if (isPacked(c->srcFormat))
 

[FFmpeg-cvslog] lavu: Bump version for the 12bit Planar YUV support

2017-03-21 Thread Luca Barbato
ffmpeg | branch: master | Luca Barbato  | Mon Sep 26 
18:16:39 2016 +0200| [0e8d1fc1f013eb805a7b66656d9452bcbca36d22] | committer: 
Luca Barbato

lavu: Bump version for the 12bit Planar YUV support

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

 doc/APIchanges  | 3 +++
 libavutil/version.h | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 43e3262..6859081 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -13,6 +13,9 @@ libavutil: 2015-08-28
 
 API changes, most recent first:
 
+2016-xx-xx - xxx - lavu 55.22.0 - pixfmt.h
+  Add AV_PIX_FMT_YUV(420,422,444)P12.
+
 2016-xx-xx - xxx - lavc 59.27.0 - avcodec.h
   Add FF_PROFILE_HEVC_REXT, the extended pixel format profile for HEVC.
 
diff --git a/libavutil/version.h b/libavutil/version.h
index f63dfa5..f05e72c 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -54,7 +54,7 @@
  */
 
 #define LIBAVUTIL_VERSION_MAJOR 55
-#define LIBAVUTIL_VERSION_MINOR 21
+#define LIBAVUTIL_VERSION_MINOR 22
 #define LIBAVUTIL_VERSION_MICRO  0
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \

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


[FFmpeg-cvslog] Merge commit '0e8d1fc1f013eb805a7b66656d9452bcbca36d22'

2017-03-21 Thread Clément Bœsch
ffmpeg | branch: master | Clément Bœsch  | Tue Mar 21 12:50:30 
2017 +0100| [876e32f7fc173ee40318a905e2fe2f0356dda409] | committer: Clément 
Bœsch

Merge commit '0e8d1fc1f013eb805a7b66656d9452bcbca36d22'

* commit '0e8d1fc1f013eb805a7b66656d9452bcbca36d22':
  lavu: Bump version for the 12bit Planar YUV support
  pixfmt: Add yuv444p12 pixel format
  pixfmt: Add yuv422p12 pixel format
  pixfmt: Add yuv420p12 pixel format

This merge is a noop, we already have all these pixel formats.

Merged-by: Clément Bœsch 

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



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


[FFmpeg-cvslog] pixfmt: Add yuv422p12 pixel format

2017-03-21 Thread Luca Barbato
ffmpeg | branch: master | Luca Barbato  | Sat Sep 24 
20:22:56 2016 +0200| [0aebbbd024762d3c9c13f4bf0607710feee5e73a] | committer: 
Luca Barbato

pixfmt: Add yuv422p12 pixel format

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

 libavutil/pixdesc.c   | 25 +
 libavutil/pixfmt.h|  4 
 libswscale/input.c|  4 
 libswscale/swscale_unscaled.c |  4 +++-
 libswscale/utils.c|  2 ++
 tests/ref/fate/filter-pixdesc-yuv422p12be |  1 +
 tests/ref/fate/filter-pixdesc-yuv422p12le |  1 +
 tests/ref/fate/filter-pixfmts-copy|  2 ++
 tests/ref/fate/filter-pixfmts-null|  2 ++
 tests/ref/fate/filter-pixfmts-scale   |  2 ++
 tests/ref/fate/filter-pixfmts-vflip   |  2 ++
 11 files changed, 48 insertions(+), 1 deletion(-)

diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index 8f116fc..e0c7851 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -1270,6 +1270,30 @@ static const AVPixFmtDescriptor 
av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
 },
 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
 },
+[AV_PIX_FMT_YUV422P12LE] = {
+.name = "yuv422p12le",
+.nb_components = 3,
+.log2_chroma_w = 1,
+.log2_chroma_h = 0,
+.comp = {
+{ 0, 2, 0, 0, 12, 1, 11, 1 },/* Y */
+{ 1, 2, 0, 0, 12, 1, 11, 1 },/* U */
+{ 2, 2, 0, 0, 12, 1, 11, 1 },/* V */
+},
+.flags = AV_PIX_FMT_FLAG_PLANAR,
+},
+[AV_PIX_FMT_YUV422P12BE] = {
+.name = "yuv422p12be",
+.nb_components = 3,
+.log2_chroma_w = 1,
+.log2_chroma_h = 0,
+.comp = {
+{ 0, 2, 0, 0, 12, 1, 11, 1 },/* Y */
+{ 1, 2, 0, 0, 12, 1, 11, 1 },/* U */
+{ 2, 2, 0, 0, 12, 1, 11, 1 },/* V */
+},
+.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
+},
 [AV_PIX_FMT_YUV422P16LE] = {
 .name = "yuv422p16le",
 .nb_components = 3,
@@ -1867,6 +1891,7 @@ enum AVPixelFormat av_pix_fmt_swap_endianness(enum 
AVPixelFormat pix_fmt)
 PIX_FMT_SWAP_ENDIANNESS(YUV422P10);
 PIX_FMT_SWAP_ENDIANNESS(YUV444P10);
 PIX_FMT_SWAP_ENDIANNESS(YUV420P12);
+PIX_FMT_SWAP_ENDIANNESS(YUV422P12);
 PIX_FMT_SWAP_ENDIANNESS(YUV420P16);
 PIX_FMT_SWAP_ENDIANNESS(YUV422P16);
 PIX_FMT_SWAP_ENDIANNESS(YUV444P16);
diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
index 658d5bf..3e356af 100644
--- a/libavutil/pixfmt.h
+++ b/libavutil/pixfmt.h
@@ -233,6 +233,9 @@ enum AVPixelFormat {
 AV_PIX_FMT_YUV420P12BE, ///< planar YUV 4:2:0, 18bpp, (1 Cr & Cb sample 
per 2x2 Y), big-endian
 AV_PIX_FMT_YUV420P12LE, ///< planar YUV 4:2:0, 18bpp, (1 Cr & Cb sample 
per 2x2 Y), little-endian
 
+AV_PIX_FMT_YUV422P12BE, ///< planar YUV 4:2:2, 24bpp, (1 Cr & Cb sample 
per 2x1 Y samples), big-endian
+AV_PIX_FMT_YUV422P12LE, ///< planar YUV 4:2:2, 24bpp, (1 Cr & Cb sample 
per 2x1 Y samples), little-endian
+
 AV_PIX_FMT_NB,///< number of pixel formats, DO NOT USE THIS if you 
want to link with shared libav* because the number of formats might differ 
between versions
 };
 
@@ -267,6 +270,7 @@ enum AVPixelFormat {
 #define AV_PIX_FMT_YUV422P10 AV_PIX_FMT_NE(YUV422P10BE, YUV422P10LE)
 #define AV_PIX_FMT_YUV444P10 AV_PIX_FMT_NE(YUV444P10BE, YUV444P10LE)
 #define AV_PIX_FMT_YUV420P12 AV_PIX_FMT_NE(YUV420P12BE, YUV420P12LE)
+#define AV_PIX_FMT_YUV422P12 AV_PIX_FMT_NE(YUV422P12BE, YUV422P12LE)
 #define AV_PIX_FMT_YUV420P16 AV_PIX_FMT_NE(YUV420P16BE, YUV420P16LE)
 #define AV_PIX_FMT_YUV422P16 AV_PIX_FMT_NE(YUV422P16BE, YUV422P16LE)
 #define AV_PIX_FMT_YUV444P16 AV_PIX_FMT_NE(YUV444P16BE, YUV444P16LE)
diff --git a/libswscale/input.c b/libswscale/input.c
index 9c0a32c..76a4700 100644
--- a/libswscale/input.c
+++ b/libswscale/input.c
@@ -816,6 +816,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
 case AV_PIX_FMT_YUV422P10LE:
 case AV_PIX_FMT_YUV444P10LE:
 case AV_PIX_FMT_YUV420P12LE:
+case AV_PIX_FMT_YUV422P12LE:
 case AV_PIX_FMT_YUV420P16LE:
 case AV_PIX_FMT_YUV422P16LE:
 case AV_PIX_FMT_YUV444P16LE:
@@ -838,6 +839,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
 case AV_PIX_FMT_YUV422P10BE:
 case AV_PIX_FMT_YUV444P10BE:
 case AV_PIX_FMT_YUV420P12BE:
+case AV_PIX_FMT_YUV422P12BE:
 case AV_PIX_FMT_YUV420P16BE:
 case AV_PIX_FMT_YUV422P16BE:
 case AV_PIX_FMT_YUV444P16BE:
@@ -1036,6 +1038,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
 case AV_PIX_FMT_YUV422P10LE:
 case AV_PIX_FMT_YUV444P10LE:
 case AV_PIX_FMT_YUV420P12LE:
+case AV_PIX_FMT_YUV422P12LE:
 case AV_PIX_FMT_YUV420P16LE:
 case AV_PIX_FMT_YUV422P16LE:
 case AV_PIX_FMT_YUV444P16LE:
@@ -1062,6 +1065,7 @@ av_cold void 

[FFmpeg-cvslog] pixfmt: Add yuv420p12 pixel format

2017-03-21 Thread Luca Barbato
ffmpeg | branch: master | Luca Barbato  | Sat Sep 24 
22:48:48 2016 +0200| [85406e7a8d5ad12db15ef9d713d0bc3d870fafee] | committer: 
Luca Barbato

pixfmt: Add yuv420p12 pixel format

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

 libavutil/pixdesc.c   | 25 +
 libavutil/pixfmt.h|  4 
 libswscale/input.c|  4 
 libswscale/output.c   |  9 -
 libswscale/swscale_unscaled.c |  4 +++-
 libswscale/utils.c|  2 ++
 tests/ref/fate/filter-pixdesc-yuv420p12be |  1 +
 tests/ref/fate/filter-pixdesc-yuv420p12le |  1 +
 tests/ref/fate/filter-pixfmts-copy|  2 ++
 tests/ref/fate/filter-pixfmts-null|  2 ++
 tests/ref/fate/filter-pixfmts-scale   |  2 ++
 tests/ref/fate/filter-pixfmts-vflip   |  2 ++
 12 files changed, 56 insertions(+), 2 deletions(-)

diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index cf2ea9c..8f116fc 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -1174,6 +1174,30 @@ static const AVPixFmtDescriptor 
av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
 },
 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
 },
+[AV_PIX_FMT_YUV420P12LE] = {
+.name = "yuv420p12le",
+.nb_components = 3,
+.log2_chroma_w = 1,
+.log2_chroma_h = 1,
+.comp = {
+{ 0, 2, 0, 0, 12, 1, 11, 1 },/* Y */
+{ 1, 2, 0, 0, 12, 1, 11, 1 },/* U */
+{ 2, 2, 0, 0, 12, 1, 11, 1 },/* V */
+},
+.flags = AV_PIX_FMT_FLAG_PLANAR,
+},
+[AV_PIX_FMT_YUV420P12BE] = {
+.name = "yuv420p12be",
+.nb_components = 3,
+.log2_chroma_w = 1,
+.log2_chroma_h = 1,
+.comp = {
+{ 0, 2, 0, 0, 12, 1, 11, 1 },/* Y */
+{ 1, 2, 0, 0, 12, 1, 11, 1 },/* U */
+{ 2, 2, 0, 0, 12, 1, 11, 1 },/* V */
+},
+.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
+},
 [AV_PIX_FMT_YUV420P16LE] = {
 .name = "yuv420p16le",
 .nb_components = 3,
@@ -1842,6 +1866,7 @@ enum AVPixelFormat av_pix_fmt_swap_endianness(enum 
AVPixelFormat pix_fmt)
 PIX_FMT_SWAP_ENDIANNESS(YUV420P10);
 PIX_FMT_SWAP_ENDIANNESS(YUV422P10);
 PIX_FMT_SWAP_ENDIANNESS(YUV444P10);
+PIX_FMT_SWAP_ENDIANNESS(YUV420P12);
 PIX_FMT_SWAP_ENDIANNESS(YUV420P16);
 PIX_FMT_SWAP_ENDIANNESS(YUV422P16);
 PIX_FMT_SWAP_ENDIANNESS(YUV444P16);
diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
index 8a8d624..658d5bf 100644
--- a/libavutil/pixfmt.h
+++ b/libavutil/pixfmt.h
@@ -230,6 +230,9 @@ enum AVPixelFormat {
 AV_PIX_FMT_P010LE, ///< like NV12, with 10bpp per component, data in the 
high bits, zeros in the low bits, little-endian
 AV_PIX_FMT_P010BE, ///< like NV12, with 10bpp per component, data in the 
high bits, zeros in the low bits, big-endian
 
+AV_PIX_FMT_YUV420P12BE, ///< planar YUV 4:2:0, 18bpp, (1 Cr & Cb sample 
per 2x2 Y), big-endian
+AV_PIX_FMT_YUV420P12LE, ///< planar YUV 4:2:0, 18bpp, (1 Cr & Cb sample 
per 2x2 Y), little-endian
+
 AV_PIX_FMT_NB,///< number of pixel formats, DO NOT USE THIS if you 
want to link with shared libav* because the number of formats might differ 
between versions
 };
 
@@ -263,6 +266,7 @@ enum AVPixelFormat {
 #define AV_PIX_FMT_YUV420P10 AV_PIX_FMT_NE(YUV420P10BE, YUV420P10LE)
 #define AV_PIX_FMT_YUV422P10 AV_PIX_FMT_NE(YUV422P10BE, YUV422P10LE)
 #define AV_PIX_FMT_YUV444P10 AV_PIX_FMT_NE(YUV444P10BE, YUV444P10LE)
+#define AV_PIX_FMT_YUV420P12 AV_PIX_FMT_NE(YUV420P12BE, YUV420P12LE)
 #define AV_PIX_FMT_YUV420P16 AV_PIX_FMT_NE(YUV420P16BE, YUV420P16LE)
 #define AV_PIX_FMT_YUV422P16 AV_PIX_FMT_NE(YUV422P16BE, YUV422P16LE)
 #define AV_PIX_FMT_YUV444P16 AV_PIX_FMT_NE(YUV444P16BE, YUV444P16LE)
diff --git a/libswscale/input.c b/libswscale/input.c
index 69c6729..9c0a32c 100644
--- a/libswscale/input.c
+++ b/libswscale/input.c
@@ -815,6 +815,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
 case AV_PIX_FMT_YUV420P10LE:
 case AV_PIX_FMT_YUV422P10LE:
 case AV_PIX_FMT_YUV444P10LE:
+case AV_PIX_FMT_YUV420P12LE:
 case AV_PIX_FMT_YUV420P16LE:
 case AV_PIX_FMT_YUV422P16LE:
 case AV_PIX_FMT_YUV444P16LE:
@@ -836,6 +837,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
 case AV_PIX_FMT_YUV420P10BE:
 case AV_PIX_FMT_YUV422P10BE:
 case AV_PIX_FMT_YUV444P10BE:
+case AV_PIX_FMT_YUV420P12BE:
 case AV_PIX_FMT_YUV420P16BE:
 case AV_PIX_FMT_YUV422P16BE:
 case AV_PIX_FMT_YUV444P16BE:
@@ -1033,6 +1035,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
 case AV_PIX_FMT_YUV420P10LE:
 case AV_PIX_FMT_YUV422P10LE:
 case AV_PIX_FMT_YUV444P10LE:
+case AV_PIX_FMT_YUV420P12LE:
 case AV_PIX_FMT_YUV420P16LE:
 case 

[FFmpeg-cvslog] lavc/hwaccel: fix header copyright

2017-03-21 Thread Clément Bœsch
ffmpeg | branch: master | Clément Bœsch  | Tue Mar 21 12:34:50 
2017 +0100| [6476bb84bca36b4af5427c5e733fd7b33a985700] | committer: Clément 
Bœsch

lavc/hwaccel: fix header copyright

It was done on a whim because of the FATE header check and was actually
meant to be removed before pushing.

Also, nobody in review spotted it.

Reviewed-by: wm4

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

 libavcodec/hwaccel.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/hwaccel.h b/libavcodec/hwaccel.h
index 17af437..124fbbf 100644
--- a/libavcodec/hwaccel.h
+++ b/libavcodec/hwaccel.h
@@ -1,5 +1,5 @@
 /*
- * This file is part of FFmpeg and was stolen from Libav.
+ * 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

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


[FFmpeg-cvslog] Merge commit '2b5b1e1e9b89063d352e2efed014f9d761b85032'

2017-03-21 Thread Clément Bœsch
ffmpeg | branch: master | Clément Bœsch  | Tue Mar 21 12:19:25 
2017 +0100| [51f88ac57b9006085c9afce65cd005f868e1d60e] | committer: Clément 
Bœsch

Merge commit '2b5b1e1e9b89063d352e2efed014f9d761b85032'

* commit '2b5b1e1e9b89063d352e2efed014f9d761b85032':
  swscale: Rename is9_OR_10 to match what it does

This commit is a noop. We use isNBPS() in these places instead since
d736b52a04. is9_15BPS() wouldn't be a good name in our codebase due to
supporting only up to 14 (see 2ea585b8e3).

Merged-by: Clément Bœsch 

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



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


[FFmpeg-cvslog] swscale: Rename is9_OR_10 to match what it does

2017-03-21 Thread Luca Barbato
ffmpeg | branch: master | Luca Barbato  | Tue Sep 27 
18:13:37 2016 +0200| [2b5b1e1e9b89063d352e2efed014f9d761b85032] | committer: 
Luca Barbato

swscale: Rename is9_OR_10 to match what it does

It is used to select functions that work with 9-15bits.

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

 libswscale/output.c   | 2 +-
 libswscale/ppc/swscale_altivec.c  | 2 +-
 libswscale/swscale.c  | 4 ++--
 libswscale/swscale_internal.h | 2 +-
 libswscale/swscale_unscaled.c | 8 
 libswscale/x86/swscale_template.c | 2 +-
 6 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/libswscale/output.c b/libswscale/output.c
index 93b3db6..6a51bb9 100644
--- a/libswscale/output.c
+++ b/libswscale/output.c
@@ -1364,7 +1364,7 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c,
 if (is16BPS(dstFormat)) {
 *yuv2planeX = isBE(dstFormat) ? yuv2planeX_16BE_c  : yuv2planeX_16LE_c;
 *yuv2plane1 = isBE(dstFormat) ? yuv2plane1_16BE_c  : yuv2plane1_16LE_c;
-} else if (is9_OR_10BPS(dstFormat)) {
+} else if (is9_15BPS(dstFormat)) {
 if (desc->comp[0].depth == 9) {
 *yuv2planeX = isBE(dstFormat) ? yuv2planeX_9BE_c  : 
yuv2planeX_9LE_c;
 *yuv2plane1 = isBE(dstFormat) ? yuv2plane1_9BE_c  : 
yuv2plane1_9LE_c;
diff --git a/libswscale/ppc/swscale_altivec.c b/libswscale/ppc/swscale_altivec.c
index 004b385..9e3ddf3 100644
--- a/libswscale/ppc/swscale_altivec.c
+++ b/libswscale/ppc/swscale_altivec.c
@@ -298,7 +298,7 @@ av_cold void ff_sws_init_swscale_ppc(SwsContext *c)
 if (c->srcBpc == 8 && c->dstBpc <= 10) {
 c->hyScale = c->hcScale = hScale_altivec_real;
 }
-if (!is16BPS(dstFormat) && !is9_OR_10BPS(dstFormat) &&
+if (!is16BPS(dstFormat) && !is9_15BPS(dstFormat) &&
 dstFormat != AV_PIX_FMT_NV12 && dstFormat != AV_PIX_FMT_NV21 &&
 !c->alpPixBuf) {
 c->yuv2planeX = yuv2planeX_altivec;
diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index 142c79c..987a3bb 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -386,7 +386,7 @@ static int swscale(SwsContext *c, const uint8_t *src[],
 yuv2anyX_fn yuv2anyX = c->yuv2anyX;
 const int chrSrcSliceY   =srcSliceY >> 
c->chrSrcVSubSample;
 const int chrSrcSliceH   = AV_CEIL_RSHIFT(srcSliceH,   
c->chrSrcVSubSample);
-int should_dither= is9_OR_10BPS(c->srcFormat) ||
+int should_dither= is9_15BPS(c->srcFormat) ||
is16BPS(c->srcFormat);
 int lastDstY;
 
@@ -696,7 +696,7 @@ static int swscale(SwsContext *c, const uint8_t *src[],
 if (is16BPS(c->dstFormat))
 length *= 2;
 
-if (is9_OR_10BPS(dstFormat)) {
+if (is9_15BPS(dstFormat)) {
 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(dstFormat);
 fill_plane9or10(dst[3], dstStride[3], length, height, lastDstY,
 255, desc->comp[3].depth, isBE(dstFormat));
diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h
index 625bd86..abcdb9f 100644
--- a/libswscale/swscale_internal.h
+++ b/libswscale/swscale_internal.h
@@ -565,7 +565,7 @@ static av_always_inline int is16BPS(enum AVPixelFormat 
pix_fmt)
 return desc->comp[0].depth == 16;
 }
 
-static av_always_inline int is9_OR_10BPS(enum AVPixelFormat pix_fmt)
+static av_always_inline int is9_15BPS(enum AVPixelFormat pix_fmt)
 {
 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
 av_assert0(desc);
diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c
index 0e6be51..fbdc2af 100644
--- a/libswscale/swscale_unscaled.c
+++ b/libswscale/swscale_unscaled.c
@@ -813,7 +813,7 @@ static int planarCopyWrapper(SwsContext *c, const uint8_t 
*src[],
 int val = (plane == 3) ? 255 : 128;
 if (is16BPS(c->dstFormat))
 length *= 2;
-if (is9_OR_10BPS(c->dstFormat)) {
+if (is9_15BPS(c->dstFormat)) {
 fill_plane9or10(dst[plane], dstStride[plane],
 length, height, y, val,
 desc_dst->comp[plane].depth,
@@ -822,7 +822,7 @@ static int planarCopyWrapper(SwsContext *c, const uint8_t 
*src[],
 fillPlane(dst[plane], dstStride[plane], length, height, y,
   val);
 } else {
-if (is9_OR_10BPS(c->srcFormat)) {
+if (is9_15BPS(c->srcFormat)) {
 const int src_depth = desc_src->comp[plane].depth;
 const int dst_depth = desc_dst->comp[plane].depth;
 const uint16_t *srcPtr2 = (const uint16_t *) srcPtr;
@@ -862,7 +862,7 @@ static int planarCopyWrapper(SwsContext *c, const uint8_t 
*src[],
 COPY9_OR_10TO16(AV_RL16, AV_WL16);

[FFmpeg-cvslog] Merge commit 'e87a501e7d03ac68b58520108fe24ad9d0b36765'

2017-03-21 Thread Clément Bœsch
ffmpeg | branch: master | Clément Bœsch  | Tue Mar 21 12:17:05 
2017 +0100| [2ea585b8e3f6b6e1f10ecaa4cad6e170485c8f10] | committer: Clément 
Bœsch

Merge commit 'e87a501e7d03ac68b58520108fe24ad9d0b36765'

* commit 'e87a501e7d03ac68b58520108fe24ad9d0b36765':
  swscale: Update bitdepth range check

This commit is a noop.

Up to 14 bits is supported since fa36f33422. This commits pushes the
limit to 15 bits but we don't seem to have pixel formats that enters in
that category.

12:03  so what's your opinion? should we move to 15 even if unused 
currently to make it consistent with libav and the function names, or keep our 
14 suggesting there might be an issue with 15?
12:05  (functions are called hScale8To15_c, hScale16To15_c, 
ff_hscale8to15, ...)
12:06  I prefer to keep 14 until theres a case that allows us to 
test this and i suspect it will not work with 15 at least not all the code

Merged-by: Clément Bœsch 

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



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


[FFmpeg-cvslog] swscale: Update bitdepth range check

2017-03-21 Thread Luca Barbato
ffmpeg | branch: master | Luca Barbato  | Sun Sep 25 
16:23:20 2016 +0200| [e87a501e7d03ac68b58520108fe24ad9d0b36765] | committer: 
Luca Barbato

swscale: Update bitdepth range check

Make sure the scaling functions for the 9-15bits are used for
9-15bits bit depths correctly.

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

 libswscale/swscale.c  |  6 +++---
 libswscale/swscale_internal.h |  2 +-
 libswscale/x86/swscale.c  | 14 +++---
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index 1319808..142c79c 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -731,7 +731,7 @@ static av_cold void sws_init_swscale(SwsContext *c)
 ff_sws_init_input_funcs(c);
 
 if (c->srcBpc == 8) {
-if (c->dstBpc <= 10) {
+if (c->dstBpc <= 15) {
 c->hyScale = c->hcScale = hScale8To15_c;
 if (c->flags & SWS_FAST_BILINEAR) {
 c->hyscale_fast = hyscale_fast_c;
@@ -741,12 +741,12 @@ static av_cold void sws_init_swscale(SwsContext *c)
 c->hyScale = c->hcScale = hScale8To19_c;
 }
 } else {
-c->hyScale = c->hcScale = c->dstBpc > 10 ? hScale16To19_c
+c->hyScale = c->hcScale = c->dstBpc > 15 ? hScale16To19_c
  : hScale16To15_c;
 }
 
 if (c->srcRange != c->dstRange && !isAnyRGB(c->dstFormat)) {
-if (c->dstBpc <= 10) {
+if (c->dstBpc <= 15) {
 if (c->srcRange) {
 c->lumConvertRange = lumRangeFromJpeg_c;
 c->chrConvertRange = chrRangeFromJpeg_c;
diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h
index 84f8dd3..625bd86 100644
--- a/libswscale/swscale_internal.h
+++ b/libswscale/swscale_internal.h
@@ -569,7 +569,7 @@ static av_always_inline int is9_OR_10BPS(enum AVPixelFormat 
pix_fmt)
 {
 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
 av_assert0(desc);
-return desc->comp[0].depth == 9 || desc->comp[0].depth == 10;
+return desc->comp[0].depth >= 9 && desc->comp[0].depth <= 15;
 }
 
 static av_always_inline int isBE(enum AVPixelFormat pix_fmt)
diff --git a/libswscale/x86/swscale.c b/libswscale/x86/swscale.c
index ec77467..48b5b49 100644
--- a/libswscale/x86/swscale.c
+++ b/libswscale/x86/swscale.c
@@ -316,16 +316,16 @@ av_cold void ff_sws_init_swscale_x86(SwsContext *c)
 
 #define ASSIGN_SCALE_FUNC2(hscalefn, filtersize, opt1, opt2) do { \
 if (c->srcBpc == 8) { \
-hscalefn = c->dstBpc <= 10 ? ff_hscale8to15_ ## filtersize ## _ ## 
opt2 : \
+hscalefn = c->dstBpc <= 15 ? ff_hscale8to15_ ## filtersize ## _ ## 
opt2 : \
  ff_hscale8to19_ ## filtersize ## _ ## 
opt1; \
 } else if (c->srcBpc == 9) { \
-hscalefn = c->dstBpc <= 10 ? ff_hscale9to15_ ## filtersize ## _ ## 
opt2 : \
+hscalefn = c->dstBpc <= 15 ? ff_hscale9to15_ ## filtersize ## _ ## 
opt2 : \
  ff_hscale9to19_ ## filtersize ## _ ## 
opt1; \
 } else if (c->srcBpc == 10) { \
-hscalefn = c->dstBpc <= 10 ? ff_hscale10to15_ ## filtersize ## _ ## 
opt2 : \
+hscalefn = c->dstBpc <= 15 ? ff_hscale10to15_ ## filtersize ## _ ## 
opt2 : \
  ff_hscale10to19_ ## filtersize ## _ ## 
opt1; \
-} else /* c->srcBpc == 16 */ { \
-hscalefn = c->dstBpc <= 10 ? ff_hscale16to15_ ## filtersize ## _ ## 
opt2 : \
+} else if (c->srcBpc == 16) { \
+hscalefn = c->dstBpc <= 15 ? ff_hscale16to15_ ## filtersize ## _ ## 
opt2 : \
  ff_hscale16to19_ ## filtersize ## _ ## 
opt1; \
 } \
 } while (0)
@@ -340,14 +340,14 @@ switch(c->dstBpc){ \
 case 16:  do_16_case;  
break; \
 case 10: if (!isBE(c->dstFormat)) vscalefn = ff_yuv2planeX_10_ ## opt; 
break; \
 case 9:  if (!isBE(c->dstFormat)) vscalefn = ff_yuv2planeX_9_  ## opt; 
break; \
-default: if (condition_8bit)  vscalefn = ff_yuv2planeX_8_  ## opt; 
break; \
+case 8:  if (condition_8bit)  vscalefn = ff_yuv2planeX_8_  ## opt; 
break; \
 }
 #define ASSIGN_VSCALE_FUNC(vscalefn, opt1, opt2, opt2chk) \
 switch(c->dstBpc){ \
 case 16: if (!isBE(c->dstFormat))vscalefn = ff_yuv2plane1_16_ 
## opt1; break; \
 case 10: if (!isBE(c->dstFormat) && opt2chk) vscalefn = ff_yuv2plane1_10_ 
## opt2; break; \
 case 9:  if (!isBE(c->dstFormat) && opt2chk) vscalefn = ff_yuv2plane1_9_  
## opt2;  break; \
-default: vscalefn = ff_yuv2plane1_8_  
## opt1;  break; \
+case 8:  vscalefn = ff_yuv2plane1_8_  
## opt1;  break; \
 }
 #define case_rgb(x, X, opt) \
 case AV_PIX_FMT_ ## X: \


[FFmpeg-cvslog] avcodec/fmvc: small refactoring in decode_type1()

2017-03-21 Thread Diego Biurrun
ffmpeg | branch: master | Diego Biurrun  | Tue Mar 21 
11:46:43 2017 +0100| [b4da4307a91e477e98f62498590a5dafb9d08204] | committer: 
Paul B Mahol

avcodec/fmvc: small refactoring in decode_type1()

Signed-off-by: Paul B Mahol 

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

 libavcodec/fmvc.c | 12 
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/libavcodec/fmvc.c b/libavcodec/fmvc.c
index 9c452da..1f8b0c5 100644
--- a/libavcodec/fmvc.c
+++ b/libavcodec/fmvc.c
@@ -380,18 +380,14 @@ static int decode_type1(GetByteContext *gb, 
PutByteContext *pb)
 bytestream2_put_byte(pb, bytestream2_get_byte());
 bytestream2_put_byte(pb, bytestream2_get_byte());
 bytestream2_put_byte(pb, bytestream2_get_byte());
-do {
-bytestream2_put_byte(pb, bytestream2_get_byte());
---len;
-} while (len && bytestream2_get_bytes_left() > 0);
 } else {
 bytestream2_put_le32(pb, bytestream2_get_le32());
 len--;
-do {
-bytestream2_put_byte(pb, bytestream2_get_byte());
-len--;
-} while (len && bytestream2_get_bytes_left() > 0);
 }
+do {
+bytestream2_put_byte(pb, bytestream2_get_byte());
+len--;
+} while (len && bytestream2_get_bytes_left() > 0);
 }
 
 return 0;

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


[FFmpeg-cvslog] swscale: Consistently order input YUV pixel formats

2017-03-21 Thread Vittorio Giovara
ffmpeg | branch: master | Vittorio Giovara  | Sun 
Sep 25 17:09:57 2016 -0400| [de8e096c7eda2bce76efd0a1c1c89d37348c2414] | 
committer: Diego Biurrun

swscale: Consistently order input YUV pixel formats

Follow a 420, 422, 444 order instead of a random one.
This simplifies double-checking additions of new formats.

Signed-off-by: Diego Biurrun 

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

 libswscale/input.c | 58 +++---
 1 file changed, 29 insertions(+), 29 deletions(-)

diff --git a/libswscale/input.c b/libswscale/input.c
index 9a4fd77..69c6729 100644
--- a/libswscale/input.c
+++ b/libswscale/input.c
@@ -809,42 +809,42 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
 c->readChrPlanar = planar_rgb_to_uv;
 break;
 #if HAVE_BIGENDIAN
-case AV_PIX_FMT_YUV444P9LE:
-case AV_PIX_FMT_YUV422P9LE:
 case AV_PIX_FMT_YUV420P9LE:
+case AV_PIX_FMT_YUV422P9LE:
+case AV_PIX_FMT_YUV444P9LE:
+case AV_PIX_FMT_YUV420P10LE:
 case AV_PIX_FMT_YUV422P10LE:
 case AV_PIX_FMT_YUV444P10LE:
-case AV_PIX_FMT_YUV420P10LE:
 case AV_PIX_FMT_YUV420P16LE:
 case AV_PIX_FMT_YUV422P16LE:
 case AV_PIX_FMT_YUV444P16LE:
-case AV_PIX_FMT_YUVA444P9LE:
-case AV_PIX_FMT_YUVA422P9LE:
 case AV_PIX_FMT_YUVA420P9LE:
+case AV_PIX_FMT_YUVA422P9LE:
+case AV_PIX_FMT_YUVA444P9LE:
+case AV_PIX_FMT_YUVA420P10LE:
 case AV_PIX_FMT_YUVA422P10LE:
 case AV_PIX_FMT_YUVA444P10LE:
-case AV_PIX_FMT_YUVA420P10LE:
 case AV_PIX_FMT_YUVA420P16LE:
 case AV_PIX_FMT_YUVA422P16LE:
 case AV_PIX_FMT_YUVA444P16LE:
 c->chrToYV12 = bswap16UV_c;
 break;
 #else
-case AV_PIX_FMT_YUV444P9BE:
-case AV_PIX_FMT_YUV422P9BE:
 case AV_PIX_FMT_YUV420P9BE:
-case AV_PIX_FMT_YUV444P10BE:
-case AV_PIX_FMT_YUV422P10BE:
+case AV_PIX_FMT_YUV422P9BE:
+case AV_PIX_FMT_YUV444P9BE:
 case AV_PIX_FMT_YUV420P10BE:
+case AV_PIX_FMT_YUV422P10BE:
+case AV_PIX_FMT_YUV444P10BE:
 case AV_PIX_FMT_YUV420P16BE:
 case AV_PIX_FMT_YUV422P16BE:
 case AV_PIX_FMT_YUV444P16BE:
-case AV_PIX_FMT_YUVA444P9BE:
-case AV_PIX_FMT_YUVA422P9BE:
 case AV_PIX_FMT_YUVA420P9BE:
+case AV_PIX_FMT_YUVA422P9BE:
+case AV_PIX_FMT_YUVA444P9BE:
+case AV_PIX_FMT_YUVA420P10BE:
 case AV_PIX_FMT_YUVA422P10BE:
 case AV_PIX_FMT_YUVA444P10BE:
-case AV_PIX_FMT_YUVA420P10BE:
 case AV_PIX_FMT_YUVA420P16BE:
 case AV_PIX_FMT_YUVA422P16BE:
 case AV_PIX_FMT_YUVA444P16BE:
@@ -1027,24 +1027,24 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
 c->readLumPlanar = planar_rgb_to_y;
 break;
 #if HAVE_BIGENDIAN
-case AV_PIX_FMT_YUV444P9LE:
-case AV_PIX_FMT_YUV422P9LE:
 case AV_PIX_FMT_YUV420P9LE:
-case AV_PIX_FMT_YUV444P10LE:
-case AV_PIX_FMT_YUV422P10LE:
+case AV_PIX_FMT_YUV422P9LE:
+case AV_PIX_FMT_YUV444P9LE:
 case AV_PIX_FMT_YUV420P10LE:
+case AV_PIX_FMT_YUV422P10LE:
+case AV_PIX_FMT_YUV444P10LE:
 case AV_PIX_FMT_YUV420P16LE:
 case AV_PIX_FMT_YUV422P16LE:
 case AV_PIX_FMT_YUV444P16LE:
 case AV_PIX_FMT_GRAY16LE:
 c->lumToYV12 = bswap16Y_c;
 break;
-case AV_PIX_FMT_YUVA444P9LE:
-case AV_PIX_FMT_YUVA422P9LE:
 case AV_PIX_FMT_YUVA420P9LE:
-case AV_PIX_FMT_YUVA444P10LE:
-case AV_PIX_FMT_YUVA422P10LE:
+case AV_PIX_FMT_YUVA422P9LE:
+case AV_PIX_FMT_YUVA444P9LE:
 case AV_PIX_FMT_YUVA420P10LE:
+case AV_PIX_FMT_YUVA422P10LE:
+case AV_PIX_FMT_YUVA444P10LE:
 case AV_PIX_FMT_YUVA420P16LE:
 case AV_PIX_FMT_YUVA422P16LE:
 case AV_PIX_FMT_YUVA444P16LE:
@@ -1052,24 +1052,24 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
 c->alpToYV12 = bswap16Y_c;
 break;
 #else
-case AV_PIX_FMT_YUV444P9BE:
-case AV_PIX_FMT_YUV422P9BE:
 case AV_PIX_FMT_YUV420P9BE:
-case AV_PIX_FMT_YUV444P10BE:
-case AV_PIX_FMT_YUV422P10BE:
+case AV_PIX_FMT_YUV422P9BE:
+case AV_PIX_FMT_YUV444P9BE:
 case AV_PIX_FMT_YUV420P10BE:
+case AV_PIX_FMT_YUV422P10BE:
+case AV_PIX_FMT_YUV444P10BE:
 case AV_PIX_FMT_YUV420P16BE:
 case AV_PIX_FMT_YUV422P16BE:
 case AV_PIX_FMT_YUV444P16BE:
 case AV_PIX_FMT_GRAY16BE:
 c->lumToYV12 = bswap16Y_c;
 break;
-case AV_PIX_FMT_YUVA444P9BE:
-case AV_PIX_FMT_YUVA422P9BE:
 case AV_PIX_FMT_YUVA420P9BE:
-case AV_PIX_FMT_YUVA444P10BE:
-case AV_PIX_FMT_YUVA422P10BE:
+case AV_PIX_FMT_YUVA422P9BE:
+case AV_PIX_FMT_YUVA444P9BE:
 case AV_PIX_FMT_YUVA420P10BE:
+case AV_PIX_FMT_YUVA422P10BE:
+case AV_PIX_FMT_YUVA444P10BE:
 case AV_PIX_FMT_YUVA420P16BE:
 case AV_PIX_FMT_YUVA422P16BE:
 case AV_PIX_FMT_YUVA444P16BE:

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org

[FFmpeg-cvslog] Merge commit 'de8e096c7eda2bce76efd0a1c1c89d37348c2414'

2017-03-21 Thread Clément Bœsch
ffmpeg | branch: master | Clément Bœsch  | Tue Mar 21 08:24:34 
2017 +0100| [fa8db3f5975e4729bde7034315e9512367c0fdd0] | committer: Clément 
Bœsch

Merge commit 'de8e096c7eda2bce76efd0a1c1c89d37348c2414'

* commit 'de8e096c7eda2bce76efd0a1c1c89d37348c2414':
  swscale: Consistently order input YUV pixel formats

Merged-by: Clément Bœsch 

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

 libswscale/input.c | 98 +++---
 1 file changed, 49 insertions(+), 49 deletions(-)

diff --git a/libswscale/input.c b/libswscale/input.c
index f32f896..04a5190 100644
--- a/libswscale/input.c
+++ b/libswscale/input.c
@@ -1049,60 +1049,60 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
 c->readChrPlanar = planar_rgb_to_uv;
 break;
 #if HAVE_BIGENDIAN
-case AV_PIX_FMT_YUV444P9LE:
-case AV_PIX_FMT_YUV422P9LE:
 case AV_PIX_FMT_YUV420P9LE:
+case AV_PIX_FMT_YUV422P9LE:
+case AV_PIX_FMT_YUV444P9LE:
+case AV_PIX_FMT_YUV420P10LE:
 case AV_PIX_FMT_YUV422P10LE:
 case AV_PIX_FMT_YUV440P10LE:
 case AV_PIX_FMT_YUV444P10LE:
-case AV_PIX_FMT_YUV420P10LE:
+case AV_PIX_FMT_YUV420P12LE:
 case AV_PIX_FMT_YUV422P12LE:
 case AV_PIX_FMT_YUV440P12LE:
 case AV_PIX_FMT_YUV444P12LE:
-case AV_PIX_FMT_YUV420P12LE:
+case AV_PIX_FMT_YUV420P14LE:
 case AV_PIX_FMT_YUV422P14LE:
 case AV_PIX_FMT_YUV444P14LE:
-case AV_PIX_FMT_YUV420P14LE:
 case AV_PIX_FMT_YUV420P16LE:
 case AV_PIX_FMT_YUV422P16LE:
 case AV_PIX_FMT_YUV444P16LE:
 
-case AV_PIX_FMT_YUVA444P9LE:
-case AV_PIX_FMT_YUVA422P9LE:
 case AV_PIX_FMT_YUVA420P9LE:
-case AV_PIX_FMT_YUVA444P10LE:
-case AV_PIX_FMT_YUVA422P10LE:
+case AV_PIX_FMT_YUVA422P9LE:
+case AV_PIX_FMT_YUVA444P9LE:
 case AV_PIX_FMT_YUVA420P10LE:
+case AV_PIX_FMT_YUVA422P10LE:
+case AV_PIX_FMT_YUVA444P10LE:
 case AV_PIX_FMT_YUVA420P16LE:
 case AV_PIX_FMT_YUVA422P16LE:
 case AV_PIX_FMT_YUVA444P16LE:
 c->chrToYV12 = bswap16UV_c;
 break;
 #else
-case AV_PIX_FMT_YUV444P9BE:
-case AV_PIX_FMT_YUV422P9BE:
 case AV_PIX_FMT_YUV420P9BE:
+case AV_PIX_FMT_YUV422P9BE:
+case AV_PIX_FMT_YUV444P9BE:
+case AV_PIX_FMT_YUV420P10BE:
+case AV_PIX_FMT_YUV422P10BE:
 case AV_PIX_FMT_YUV440P10BE:
 case AV_PIX_FMT_YUV444P10BE:
-case AV_PIX_FMT_YUV422P10BE:
-case AV_PIX_FMT_YUV420P10BE:
+case AV_PIX_FMT_YUV420P12BE:
+case AV_PIX_FMT_YUV422P12BE:
 case AV_PIX_FMT_YUV440P12BE:
 case AV_PIX_FMT_YUV444P12BE:
-case AV_PIX_FMT_YUV422P12BE:
-case AV_PIX_FMT_YUV420P12BE:
-case AV_PIX_FMT_YUV444P14BE:
-case AV_PIX_FMT_YUV422P14BE:
 case AV_PIX_FMT_YUV420P14BE:
+case AV_PIX_FMT_YUV422P14BE:
+case AV_PIX_FMT_YUV444P14BE:
 case AV_PIX_FMT_YUV420P16BE:
 case AV_PIX_FMT_YUV422P16BE:
 case AV_PIX_FMT_YUV444P16BE:
 
-case AV_PIX_FMT_YUVA444P9BE:
-case AV_PIX_FMT_YUVA422P9BE:
 case AV_PIX_FMT_YUVA420P9BE:
-case AV_PIX_FMT_YUVA444P10BE:
-case AV_PIX_FMT_YUVA422P10BE:
+case AV_PIX_FMT_YUVA422P9BE:
+case AV_PIX_FMT_YUVA444P9BE:
 case AV_PIX_FMT_YUVA420P10BE:
+case AV_PIX_FMT_YUVA422P10BE:
+case AV_PIX_FMT_YUVA444P10BE:
 case AV_PIX_FMT_YUVA420P16BE:
 case AV_PIX_FMT_YUVA422P16BE:
 case AV_PIX_FMT_YUVA444P16BE:
@@ -1344,20 +1344,20 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
 c->readLumPlanar = planar_rgb_to_y;
 break;
 #if HAVE_BIGENDIAN
-case AV_PIX_FMT_YUV444P9LE:
-case AV_PIX_FMT_YUV422P9LE:
 case AV_PIX_FMT_YUV420P9LE:
-case AV_PIX_FMT_YUV444P10LE:
-case AV_PIX_FMT_YUV440P10LE:
-case AV_PIX_FMT_YUV422P10LE:
+case AV_PIX_FMT_YUV422P9LE:
+case AV_PIX_FMT_YUV444P9LE:
 case AV_PIX_FMT_YUV420P10LE:
-case AV_PIX_FMT_YUV444P12LE:
-case AV_PIX_FMT_YUV440P12LE:
-case AV_PIX_FMT_YUV422P12LE:
+case AV_PIX_FMT_YUV422P10LE:
+case AV_PIX_FMT_YUV440P10LE:
+case AV_PIX_FMT_YUV444P10LE:
 case AV_PIX_FMT_YUV420P12LE:
-case AV_PIX_FMT_YUV444P14LE:
-case AV_PIX_FMT_YUV422P14LE:
+case AV_PIX_FMT_YUV422P12LE:
+case AV_PIX_FMT_YUV440P12LE:
+case AV_PIX_FMT_YUV444P12LE:
 case AV_PIX_FMT_YUV420P14LE:
+case AV_PIX_FMT_YUV422P14LE:
+case AV_PIX_FMT_YUV444P14LE:
 case AV_PIX_FMT_YUV420P16LE:
 case AV_PIX_FMT_YUV422P16LE:
 case AV_PIX_FMT_YUV444P16LE:
@@ -1369,12 +1369,12 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
 case AV_PIX_FMT_P016LE:
 c->lumToYV12 = bswap16Y_c;
 break;
-case AV_PIX_FMT_YUVA444P9LE:
-case AV_PIX_FMT_YUVA422P9LE:
 case AV_PIX_FMT_YUVA420P9LE:
-case AV_PIX_FMT_YUVA444P10LE:
-case AV_PIX_FMT_YUVA422P10LE:
+case AV_PIX_FMT_YUVA422P9LE:
+case AV_PIX_FMT_YUVA444P9LE:
 case AV_PIX_FMT_YUVA420P10LE:
+case AV_PIX_FMT_YUVA422P10LE:
+case 

[FFmpeg-cvslog] ffmpeg: Initialize two stack variables.

2017-03-21 Thread Carl Eugen Hoyos
ffmpeg | branch: master | Carl Eugen Hoyos  | Tue Mar 21 
08:03:49 2017 +0100| [4b192ffdbe226461d8a07fd36d655ec13b2c7582] | committer: 
Carl Eugen Hoyos

ffmpeg: Initialize two stack variables.

Avoids reading from uninitialized memory, regression since af1761f7

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

 ffmpeg.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index dcb7720..4e6fc37 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1434,7 +1434,7 @@ static int reap_filters(int flush)
 filter = ost->filter->filter;
 
 if (!ost->initialized) {
-char error[1024];
+char error[1024] = "";
 ret = init_output_stream(ost, error, sizeof(error));
 if (ret < 0) {
 av_log(NULL, AV_LOG_ERROR, "Error initializing output stream 
%d:%d -- %s\n",
@@ -1847,7 +1847,7 @@ static void flush_encoders(void)
 // Maybe we should just let encoding fail instead.
 if (!ost->initialized) {
 FilterGraph *fg = ost->filter->graph;
-char error[1024];
+char error[1024] = "";
 
 av_log(NULL, AV_LOG_WARNING,
"Finishing stream %d:%d without any data written to it.\n",

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