Re: [libav-devel] [PATCH 2/5] tiffenc: Check zlib support for deflate option during initialization

2016-06-27 Thread Vittorio Giovara
On Mon, Jun 27, 2016 at 8:25 AM, Diego Biurrun  wrote:
> On Sun, Jun 26, 2016 at 08:08:54PM -0400, Vittorio Giovara wrote:
>> This converts a misleading error about an option not found to a more
>> meaningful one.
>> ---
>>  libavcodec/tiffenc.c | 10 --
>>  1 file changed, 8 insertions(+), 2 deletions(-)
>
> Good.
>
>> --- a/libavcodec/tiffenc.c
>> +++ b/libavcodec/tiffenc.c
>> @@ -490,6 +490,14 @@ fail:
>>
>>  static av_cold int encode_init(AVCodecContext *avctx)
>>  {
>> +TiffEncoderContext *s = avctx->priv_data;
>> +
>> +if (!CONFIG_ZLIB && s->compr == TIFF_DEFLATE) {
>> +av_log(avctx, AV_LOG_ERROR,
>> +   "Deflate compression needs zlib compiled in\n");
>> +return AVERROR(ENOSYS);
>> +}
>
> The rest of the file (and other places in the codebase) use #ifdefs for
> this, so I would suggest ifdefs instead.

The rest of the file uses ifdefs because it calls zlib functions that
would fail to compile, while the avoption does not.
It seems unreliable to have these kind of ifdefs in option
declaration, so if you point me to other instances int the code I'll
address them too.
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 2/2] build: Drop unnecessary libavcodec <-> libavformat object dependencies

2016-06-27 Thread Vittorio Giovara
On Mon, Jun 27, 2016 at 10:22 AM, Diego Biurrun  wrote:
> ---
>  libavcodec/Makefile | 15 ---
>  1 file changed, 15 deletions(-)

When have they become unneeded?
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 1/2] build: Move ff_mpeg12_frame_rate_tab to a separate file

2016-06-27 Thread Vittorio Giovara
On Mon, Jun 27, 2016 at 11:05 AM, Hendrik Leppkes  wrote:
> On Mon, Jun 27, 2016 at 4:22 PM, Diego Biurrun  wrote:
>> It is also used by the Dirac parsing code.
>> ---
>>  configure| 15 ---
>>  libavcodec/Makefile  |  1 +
>>  libavcodec/mpeg12data.c  | 20 
>>  libavcodec/mpeg12framerate.c | 39 +++
>>  4 files changed, 48 insertions(+), 27 deletions(-)
>>  create mode 100644 libavcodec/mpeg12framerate.c
>>
>> diff --git a/configure b/configure
>> index 1a58a4c..cc649ac 100755
>> --- a/configure
>> +++ b/configure
>> @@ -1705,6 +1705,7 @@ CONFIG_EXTRA="
>>  lzf
>>  me_cmp
>>  mpeg_er
>> +mpeg12framerate
>>  mpegaudio
>>  mpegaudiodsp
>>  mpegvideo
>
>
> Do we really need config entries for 50 line data table files, instead
> of making the relevant parts in the Makefile reference those files?
> Seems like a lot of noise to create features for single-file
> "features" that are just shared tables.

I'd tend to agree, moving the tables to a separate file is okay, but
I'd just add the .o to the Makefile rather than adding an element to
configure.

-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] ffv1: Remove version 2 and mark version 3 as non-experimental

2016-06-27 Thread Vittorio Giovara
On Mon, Jun 27, 2016 at 10:26 AM, Luca Barbato  wrote:
> On 27/06/16 05:11, Luca Barbato wrote:
>> On 27/06/16 04:38, Vittorio Giovara wrote:
>>> imho just drop anything below 3 and initialize some sane defaults.
>>
>> I might be an option.
>
> But I would do that on a second patch since it would be more invasive.

an option that triggers an assert...?
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] ffv1: Remove version 2 and mark version 3 as non-experimental

2016-06-26 Thread Vittorio Giovara
On Sat, Jun 25, 2016 at 8:39 AM, Luca Barbato  wrote:
> The encoder produces bitstream compatible with the current specification
> and version 2 is set as reserved (non-standardizable).

How about "Version 2 has not been standardized and the value has been
set as reserved"

> ---
>
> Now with updated samples and version 3 non-experimental.
>
>  libavcodec/ffv1enc.c  | 72 
> +--
>  tests/ref/seek/vsynth2-ffv1   | 40 
>  tests/ref/vsynth/vsynth1-ffv1 |  4 +--
>  tests/ref/vsynth/vsynth2-ffv1 |  4 +--
>  4 files changed, 59 insertions(+), 61 deletions(-)
>
> diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c
> index 7995376..342367c 100644
> --- a/libavcodec/ffv1enc.c
> +++ b/libavcodec/ffv1enc.c
> @@ -566,27 +547,44 @@ static av_cold int ffv1_encode_init(AVCodecContext 
> *avctx)
>
>  s->version = 0;
>
> -if ((avctx->flags & (AV_CODEC_FLAG_PASS1 | AV_CODEC_FLAG_PASS2)) ||
> -avctx->slices > 1)
> -s->version = FFMAX(s->version, 2);
> -
> -if (avctx->level == 3) {
> -s->version = 3;
> +switch (avctx->level) {
> +case 3:
> +break;
> +case 2:
> +av_log(avctx, AV_LOG_ERROR,
> +   "Version 2 had been deemed non-standard and deprecated "
> +   "the support for it had been removed\n");
> +return AVERROR(ENOSYS);
> +case 1:
> +case 0:
> +if (avctx->flags & (AV_CODEC_FLAG_PASS1 | AV_CODEC_FLAG_PASS2)) {
> +av_log(avctx, AV_LOG_ERROR,
> +   "Multiple pass encoding requires version 3.\n");
> +return AVERROR(ENOSYS);
> +}
> +if (avctx->slices > 1) {
> +av_log(avctx, AV_LOG_ERROR,
> +   "Multiple slices support requires version 3.\n");
> +return AVERROR(ENOSYS);
> +}
> +break;
> +case -99:

use FF_PROFILE_UNKNOWN

> +if ((avctx->flags & (AV_CODEC_FLAG_PASS1 | AV_CODEC_FLAG_PASS2)) ||
> +avctx->slices > 1)
> +s->version = 3;
> +else
> +s->version = 0;
> +break;
> +default:
> +av_log(avctx, AV_LOG_ERROR, "Version %d not supported\n",
> +   avctx->level);
> +return AVERROR(ENOSYS);

Why are you keeping version 0? isn't it going to trigger the assert below?

imho just drop anything below 3 and initialize some sane defaults.

>  }
>
>  if (s->ec < 0) {
>  s->ec = (s->version >= 3);
>  }
>
> -if (s->version >= 2 &&
> -avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) {
> -av_log(avctx, AV_LOG_ERROR,
> -   "Version %d requested, please set -strict experimental in "
> -   "order to enable it\n",
> -   s->version);
> -return AVERROR(ENOSYS);
> -}
> -
>  #if FF_API_CODER_TYPE
>  FF_DISABLE_DEPRECATION_WARNINGS
>  if (avctx->coder_type != -1)
> @@ -754,7 +752,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
>  int gob_count = 0;
>  char *next;
>
> -av_assert0(s->version >= 2);
> +av_assert0(s->version > 2);
>
>  for (;; ) {
>  for (j = 0; j < 256; j++)


-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH 2/5] tiffenc: Check zlib support for deflate option during initialization

2016-06-26 Thread Vittorio Giovara
This converts a misleading error about an option not found to a more
meaningful one.
---
 libavcodec/tiffenc.c | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/libavcodec/tiffenc.c b/libavcodec/tiffenc.c
index 7c23ee2..4940399 100644
--- a/libavcodec/tiffenc.c
+++ b/libavcodec/tiffenc.c
@@ -490,6 +490,14 @@ fail:
 
 static av_cold int encode_init(AVCodecContext *avctx)
 {
+TiffEncoderContext *s = avctx->priv_data;
+
+if (!CONFIG_ZLIB && s->compr == TIFF_DEFLATE) {
+av_log(avctx, AV_LOG_ERROR,
+   "Deflate compression needs zlib compiled in\n");
+return AVERROR(ENOSYS);
+}
+
 #if FF_API_CODED_FRAME
 FF_DISABLE_DEPRECATION_WARNINGS
 avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
@@ -507,9 +515,7 @@ static const AVOption options[] = {
 { "packbits", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 
TIFF_PACKBITS }, 0,0,VE, "compression_algo" },
 { "raw",  NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 
TIFF_RAW  }, 0,0,VE, "compression_algo" },
 { "lzw",  NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 
TIFF_LZW  }, 0,0,VE, "compression_algo" },
-#if CONFIG_ZLIB
 { "deflate",  NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 
TIFF_DEFLATE  }, 0,0,VE, "compression_algo" },
-#endif
 { NULL },
 };
 
-- 
2.9.0

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH 3/5] tiffenc: Check av_pix_fmt_desc_get() return value

2016-06-26 Thread Vittorio Giovara
---
 libavcodec/tiffenc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavcodec/tiffenc.c b/libavcodec/tiffenc.c
index 4940399..cf6e262 100644
--- a/libavcodec/tiffenc.c
+++ b/libavcodec/tiffenc.c
@@ -254,7 +254,9 @@ static int encode_frame(AVCodecContext *avctx, AVPacket 
*pkt,
 case AV_PIX_FMT_RGB24:
 case AV_PIX_FMT_GRAY8:
 case AV_PIX_FMT_PAL8:
-pfd= av_pix_fmt_desc_get(avctx->pix_fmt);
+pfd = av_pix_fmt_desc_get(avctx->pix_fmt);
+if (!pfd)
+return AVERROR_BUG;
 s->bpp = av_get_bits_per_pixel(pfd);
 if (pfd->flags & AV_PIX_FMT_FLAG_PAL)
 s->photometric_interpretation = TIFF_PHOTOMETRIC_PALETTE;
-- 
2.9.0

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH 1/5] targaenc: Move size check to initialization function

2016-06-26 Thread Vittorio Giovara
---
 libavcodec/targaenc.c | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/libavcodec/targaenc.c b/libavcodec/targaenc.c
index 204ecfe..f0cee38 100644
--- a/libavcodec/targaenc.c
+++ b/libavcodec/targaenc.c
@@ -89,10 +89,6 @@ static int targa_encode_frame(AVCodecContext *avctx, 
AVPacket *pkt,
 int bpp, picsize, datasize = -1, ret;
 uint8_t *out;
 
-if(avctx->width > 0x || avctx->height > 0x) {
-av_log(avctx, AV_LOG_ERROR, "image dimensions too large\n");
-return AVERROR(EINVAL);
-}
 picsize = av_image_get_buffer_size(avctx->pix_fmt,
avctx->width, avctx->height, 1);
 if ((ret = ff_alloc_packet(pkt, picsize + 45)) < 0) {
@@ -167,6 +163,11 @@ FF_ENABLE_DEPRECATION_WARNINGS
 
 static av_cold int targa_encode_init(AVCodecContext *avctx)
 {
+if (avctx->width > 0x || avctx->height > 0x) {
+av_log(avctx, AV_LOG_ERROR, "image dimensions too large\n");
+return AVERROR(EINVAL);
+}
+
 #if FF_API_CODED_FRAME
 FF_DISABLE_DEPRECATION_WARNINGS
 avctx->coded_frame->key_frame = 1;
-- 
2.9.0

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH 5/5] rle: Convert into a proper dsp module

2016-06-26 Thread Vittorio Giovara
---
 configure |  4 
 libavcodec/Makefile   |  7 ---
 libavcodec/rle.c  | 17 -
 libavcodec/rle.h  | 50 +++---
 libavcodec/sgienc.c   | 15 ++-
 libavcodec/targaenc.c | 17 +
 libavcodec/tiffenc.c  |  7 +--
 7 files changed, 75 insertions(+), 42 deletions(-)

diff --git a/configure b/configure
index 1a58a4c..eafeecf 100755
--- a/configure
+++ b/configure
@@ -1718,6 +1718,7 @@ CONFIG_EXTRA="
 rangecoder
 riffdec
 riffenc
+rledsp
 rtpdec
 rtpenc_chain
 rv34dsp
@@ -2049,17 +2050,20 @@ rv40_decoder_select="error_resilience golomb h264chroma 
h264pred h264qpel mpeg_e
 screenpresso_decoder_deps="zlib"
 shorten_decoder_select="golomb"
 sipr_decoder_select="lsp"
+sgi_encoder_select="rledsp"
 sp5x_decoder_select="mjpeg_decoder"
 svq1_decoder_select="hpeldsp"
 svq1_encoder_select="aandcttables hpeldsp me_cmp mpegvideoenc"
 svq3_decoder_select="golomb h264dsp h264pred hpeldsp tpeldsp videodsp"
 svq3_decoder_suggest="zlib"
 tak_decoder_select="audiodsp"
+targa_encoder_select="rledsp"
 tdsc_decoder_deps="zlib"
 tdsc_decoder_select="mjpeg_decoder"
 theora_decoder_select="vp3_decoder"
 thp_decoder_select="mjpeg_decoder"
 tiff_decoder_suggest="zlib"
+tiff_encoder_select="rledsp"
 tiff_encoder_suggest="zlib"
 truehd_decoder_select="mlp_decoder"
 truemotion2_decoder_select="bswapdsp"
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 622e100..44d406c 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -98,6 +98,7 @@ OBJS-$(CONFIG_QSV) += qsv.o
 OBJS-$(CONFIG_QSVDEC)  += qsvdec.o
 OBJS-$(CONFIG_QSVENC)  += qsvenc.o
 OBJS-$(CONFIG_RANGECODER)  += rangecoder.o
+OBJS-$(CONFIG_RLEDSP)  += rle.o
 RDFT-OBJS-$(CONFIG_HARDCODED_TABLES)   += sin_tables.o
 OBJS-$(CONFIG_RDFT)+= rdft.o $(RDFT-OBJS-yes)
 OBJS-$(CONFIG_RV34DSP) += rv34dsp.o
@@ -409,7 +410,7 @@ OBJS-$(CONFIG_S302M_DECODER)   += s302m.o
 OBJS-$(CONFIG_SANM_DECODER)+= sanm.o
 OBJS-$(CONFIG_SCREENPRESSO_DECODER)+= screenpresso.o
 OBJS-$(CONFIG_SGI_DECODER) += sgidec.o
-OBJS-$(CONFIG_SGI_ENCODER) += sgienc.o rle.o
+OBJS-$(CONFIG_SGI_ENCODER) += sgienc.o
 OBJS-$(CONFIG_SGIRLE_DECODER)  += sgirledec.o
 OBJS-$(CONFIG_SHORTEN_DECODER) += shorten.o
 OBJS-$(CONFIG_SIPR_DECODER)+= sipr.o acelp_pitch_delay.o \
@@ -430,11 +431,11 @@ OBJS-$(CONFIG_SVQ1_ENCODER)+= svq1enc.o 
svq1.o  h263data.o  \
 OBJS-$(CONFIG_SVQ3_DECODER)+= svq3.o svq13.o mpegutils.o 
h264_parse.o h264data.o
 OBJS-$(CONFIG_TAK_DECODER) += takdec.o tak.o
 OBJS-$(CONFIG_TARGA_DECODER)   += targa.o
-OBJS-$(CONFIG_TARGA_ENCODER)   += targaenc.o rle.o
+OBJS-$(CONFIG_TARGA_ENCODER)   += targaenc.o
 OBJS-$(CONFIG_TDSC_DECODER)+= tdsc.o
 OBJS-$(CONFIG_TIERTEXSEQVIDEO_DECODER) += tiertexseqv.o
 OBJS-$(CONFIG_TIFF_DECODER)+= tiff.o lzw.o faxcompr.o
-OBJS-$(CONFIG_TIFF_ENCODER)+= tiffenc.o rle.o lzwenc.o
+OBJS-$(CONFIG_TIFF_ENCODER)+= tiffenc.o lzwenc.o
 OBJS-$(CONFIG_TMV_DECODER) += tmv.o cga_data.o
 OBJS-$(CONFIG_TRUEMOTION1_DECODER) += truemotion1.o
 OBJS-$(CONFIG_TRUEMOTION2_DECODER) += truemotion2.o
diff --git a/libavcodec/rle.c b/libavcodec/rle.c
index 6c8bf27..37d48f1 100644
--- a/libavcodec/rle.c
+++ b/libavcodec/rle.c
@@ -24,7 +24,7 @@
 #include "avcodec.h"
 #include "rle.h"
 
-int ff_rle_count_pixels(const uint8_t *start, int len, int bpp, int same)
+static int count_pixels(const uint8_t *start, int len, int bpp, int same)
 {
 const uint8_t *pos;
 int count = 1;
@@ -49,15 +49,16 @@ int ff_rle_count_pixels(const uint8_t *start, int len, int 
bpp, int same)
 return count;
 }
 
-int ff_rle_encode(uint8_t *outbuf, int out_size, const uint8_t *ptr, int bpp,
-  int w, int add_rep, int xor_rep, int add_raw, int xor_raw)
+static int rle_encode(uint8_t *outbuf, int out_size, const uint8_t *ptr,
+  int bpp, int w, int add_rep, int xor_rep, int add_raw,
+  int xor_raw)
 {
 int count, x;
 uint8_t *out = outbuf;
 
 for (x = 0; x < w; x += count) {
 /* see if we can encode the next set of pixels with RLE */
-if ((count = ff_rle_count_pixels(ptr, w - x, bpp, 1)) > 1) {
+if ((count = count_pixels(ptr, w - x, bpp, 1)) > 1) {
 if (out + bpp + 1 > outbuf + out_size)
 return -1;
 
@@ -66,7 +67,7 @@ int ff_rle_encode(uint8_t *outbuf, int out_size, const 
uint8_t *ptr, int bpp,
 out += bpp;
 } else {
 /* fall back on uncompressed */
-count = ff_rle_count_pixels(ptr, w - x, bpp, 0);
+count = count_pixels(ptr, w - x, bpp, 0);
 if (out + bpp * count >= outbuf

[libav-devel] [PATCH 4/5] rle: K&R formatting cosmetics

2016-06-26 Thread Vittorio Giovara
---
 libavcodec/rle.c | 34 --
 libavcodec/rle.h |  9 +
 2 files changed, 25 insertions(+), 18 deletions(-)

diff --git a/libavcodec/rle.c b/libavcodec/rle.c
index 8a2d922..6c8bf27 100644
--- a/libavcodec/rle.c
+++ b/libavcodec/rle.c
@@ -18,26 +18,29 @@
  * License along with Libav; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
+
+#include "libavutil/common.h"
+
 #include "avcodec.h"
 #include "rle.h"
-#include "libavutil/common.h"
 
 int ff_rle_count_pixels(const uint8_t *start, int len, int bpp, int same)
 {
 const uint8_t *pos;
 int count = 1;
 
-for(pos = start + bpp; count < FFMIN(127, len); pos += bpp, count ++) {
-if(same != !memcmp(pos-bpp, pos, bpp)) {
-if(!same) {
-/* if bpp == 1, then 0 1 1 0 is more efficiently encoded as a 
single
- * raw block of pixels.  for larger bpp, RLE is as good or 
better */
-if(bpp == 1 && count + 1 < FFMIN(127, len) && *pos != *(pos+1))
+for (pos = start + bpp; count < FFMIN(127, len); pos += bpp, count++) {
+if (same != !memcmp(pos - bpp, pos, bpp)) {
+if (!same) {
+/* if bpp == 1, then 0 1 1 0 is more efficiently encoded as a
+ * single raw block of pixels. For larger bpp, RLE is as good
+ * or better */
+if (bpp == 1 && count + 1 < FFMIN(127, len) && *pos != *(pos + 
1))
 continue;
 
 /* if RLE can encode the next block better than as a raw block,
  * back up and leave _all_ the identical pixels for RLE */
-count --;
+count--;
 }
 break;
 }
@@ -46,25 +49,28 @@ int ff_rle_count_pixels(const uint8_t *start, int len, int 
bpp, int same)
 return count;
 }
 
-int ff_rle_encode(uint8_t *outbuf, int out_size, const uint8_t *ptr , int bpp, 
int w,
-  int add_rep, int xor_rep, int add_raw, int xor_raw)
+int ff_rle_encode(uint8_t *outbuf, int out_size, const uint8_t *ptr, int bpp,
+  int w, int add_rep, int xor_rep, int add_raw, int xor_raw)
 {
 int count, x;
 uint8_t *out = outbuf;
 
-for(x = 0; x < w; x += count) {
+for (x = 0; x < w; x += count) {
 /* see if we can encode the next set of pixels with RLE */
 if ((count = ff_rle_count_pixels(ptr, w - x, bpp, 1)) > 1) {
-if(out + bpp + 1 > outbuf + out_size) return -1;
+if (out + bpp + 1 > outbuf + out_size)
+return -1;
+
 *out++ = (count ^ xor_rep) + add_rep;
 memcpy(out, ptr, bpp);
 out += bpp;
 } else {
 /* fall back on uncompressed */
 count = ff_rle_count_pixels(ptr, w - x, bpp, 0);
-if(out + bpp*count >= outbuf + out_size) return -1;
-*out++ = (count ^ xor_raw) + add_raw;
+if (out + bpp * count >= outbuf + out_size)
+return -1;
 
+*out++ = (count ^ xor_raw) + add_raw;
 memcpy(out, ptr, bpp * count);
 out += bpp * count;
 }
diff --git a/libavcodec/rle.h b/libavcodec/rle.h
index c967764..f1b0c78 100644
--- a/libavcodec/rle.h
+++ b/libavcodec/rle.h
@@ -35,8 +35,9 @@
 int ff_rle_count_pixels(const uint8_t *start, int len, int bpp, int same);
 
 /**
- * RLE compress the row, with maximum size of out_size. Value before repeated 
bytes is (count ^ xor_rep) + add_rep.
- *  Value before raw bytes 
is  (count ^ xor_raw) + add_raw.
+ * RLE compress the row, with maximum size of out_size.
+ * Value before repeated bytes is (count ^ xor_rep) + add_rep.
+ * Value before raw bytes is (count ^ xor_raw) + add_raw.
  * @param outbuf Output buffer
  * @param out_size Maximum output size
  * @param inbuf Input buffer
@@ -44,7 +45,7 @@ int ff_rle_count_pixels(const uint8_t *start, int len, int 
bpp, int same);
  * @param w Image width
  * @return Size of output in bytes, or -1 if larger than out_size
  */
-int ff_rle_encode(uint8_t *outbuf, int out_size, const uint8_t *inbuf, int 
bpp, int w,
-  int add_rep, int xor_rep, int add_raw, int xor_raw);
+int ff_rle_encode(uint8_t *outbuf, int out_size, const uint8_t *inbuf, int bpp,
+  int w, int add_rep, int xor_rep, int add_raw, int xor_raw);
 
 #endif /* AVCODEC_RLE_H */
-- 
2.9.0

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 08/11] qsvdec: use the same mfxFrameInfo for allocating frames that was passed to DECODE_Init

2016-06-25 Thread Vittorio Giovara
On Sat, Jun 25, 2016 at 10:27 AM, Anton Khirnov  wrote:
> Stop duplicating this information.
> ---
>  libavcodec/qsvdec.c | 15 ++-
>  libavcodec/qsvdec.h |  1 +
>  2 files changed, 7 insertions(+), 9 deletions(-)

probably ok
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 01/11] pixfmt: add P010 pixel format

2016-06-25 Thread Vittorio Giovara
On Sat, Jun 25, 2016 at 10:27 AM, Anton Khirnov  wrote:
> From: Hendrik Leppkes 
>
> P010 is the 10-bit variant of NV12 (planar luma, packed chroma), using two
> bytes per component to store 10-bit data plus 6-bit zeroes in the LSBs.
>
> Signed-off-by: Anton Khirnov 
> ---
>  libavutil/pixdesc.c | 24 
>  libavutil/pixfmt.h  |  4 
>  2 files changed, 28 insertions(+)
>
> diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
> index 4e52067..0a126e6 100644
> --- a/libavutil/pixdesc.c
> +++ b/libavutil/pixdesc.c
> @@ -1590,6 +1590,30 @@ static const AVPixFmtDescriptor 
> av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
>  .name = "cuda",
>  .flags = AV_PIX_FMT_FLAG_HWACCEL,
>  },
> +[AV_PIX_FMT_P010LE] = {
> +.name = "p010le",
> +.nb_components = 3,
> +.log2_chroma_w = 1,
> +.log2_chroma_h = 1,
> +.comp = {
> +{ 0, 2, 0, 6, 10, 1, 9, 1 },/* Y */
> +{ 1, 4, 0, 6, 10, 3, 9, 1 },/* U */
> +{ 1, 4, 2, 6, 10, 3, 9, 3 },/* V */
> +},
> +.flags = AV_PIX_FMT_FLAG_PLANAR,
> +},
> +[AV_PIX_FMT_P010BE] = {
> +.name = "p010be",
> +.nb_components = 3,
> +.log2_chroma_w = 1,
> +.log2_chroma_h = 1,
> +.comp = {
> +{ 0, 2, 0, 6, 10, 1, 9, 1 },/* Y */
> +{ 1, 4, 0, 6, 10, 3, 9, 1 },/* U */
> +{ 1, 4, 2, 6, 10, 3, 9, 3 },/* V */
> +},
> +.flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_BE,
> +},
>  };
>  #if FF_API_PLUS1_MINUS1
>  FF_ENABLE_DEPRECATION_WARNINGS
> diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
> index 58d87a0..45b5b7d 100644
> --- a/libavutil/pixfmt.h
> +++ b/libavutil/pixfmt.h
> @@ -227,6 +227,9 @@ enum AVPixelFormat {
>   */
>  AV_PIX_FMT_CUDA,
>
> +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

I had thought we were going for the multiline docs for newer pixfmt

> +
>  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
>  };
>
> @@ -282,6 +285,7 @@ enum AVPixelFormat {
>
>  #define AV_PIX_FMT_XYZ12  AV_PIX_FMT_NE(XYZ12BE, XYZ12LE)
>  #define AV_PIX_FMT_NV20   AV_PIX_FMT_NE(NV20BE,  NV20LE)
> +#define AV_PIX_FMT_P010   AV_PIX_FMT_NE(P010BE,  P010LE)
>
>  /**
>* Chromaticity coordinates of the source primaries.
> --

seems ok regardless
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 1/4] pixdesc: Add aliases to SMPTE color properties

2016-06-25 Thread Vittorio Giovara
On Tue, Jun 21, 2016 at 10:22 AM, Vittorio Giovara
 wrote:
> Drop ST from names and symbols, it does not add anything distinctive or
> descriptive.
> ---
>  libavcodec/options_table.h | 9 ++---
>  libavcodec/version.h   | 2 +-
>  libavutil/pixdesc.c| 6 +++---
>  libavutil/pixfmt.h | 9 ++---
>  libavutil/version.h| 2 +-
>  5 files changed, 17 insertions(+), 11 deletions(-)

ping on the set
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 02/11] swscale: add P010 input support

2016-06-25 Thread Vittorio Giovara
On Sat, Jun 25, 2016 at 10:27 AM, Anton Khirnov  wrote:
> From: Hendrik Leppkes 
>
> Signed-off-by: Anton Khirnov 
> ---
>  libswscale/input.c| 52 
> +++
>  libswscale/swscale_unscaled.c |  4 +++-
>  libswscale/utils.c|  2 ++
>  3 files changed, 57 insertions(+), 1 deletion(-)

should be fine
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] Add an OpenH264 decoder

2016-06-23 Thread Vittorio Giovara
On Thu, Jun 23, 2016 at 3:03 PM, Martin Storsjö  wrote:
> On Thu, 23 Jun 2016, Vittorio Giovara wrote:
>
>> On Thu, Jun 23, 2016 at 7:06 AM, Martin Storsjö  wrote:
>>>
>>> While it is less featureful (and slower) than the built-in H264
>>> decoder, one could potentially want to use it to take advantage
>>> of the cisco patent license offer.
>>> ---
>>> I got a user explicitly requesting this feature, so apparently there
>>> is (some) demand for it.
>>>
>>> The decoder is very simple; it doesn't handle B-frames, so there's
>>> no decoding delay, and the decoder doesn't allow decoding into
>>> user-supplied buffers.
>>
>>
>> Can you add this blurb to a comment at the top of the file? it will
>> help when we hunt for non-DR1 codecs.
>
>
> Just a comment saying "doesn't handle b-frames, doesn't do direct
> rendering"? Sure
>
>> Could you also please mention the requirement for the bsf?
>
>
> Do you mean like "the decoder expects input packets in annex b format, thus
> using a bsf to conver to this format"?

Yes these two lines are enough, maybe mention that  the bsf acts as a
passthrough if packets already come as annexb.
Thanks
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Re: [libav-devel] [PATCH] bitstream: Add bitstream_apply_sign() helper function

2016-06-23 Thread Vittorio Giovara
On Thu, Jun 23, 2016 at 9:54 AM, Diego Biurrun  wrote:
> This reads a sign bit from the bitstream and flips the sign of the
> provided value accordingly.
> ---
>
> .. as suggested by Anton ..
>
>  libavcodec/bitstream.h | 7 +++
>  1 file changed, 7 insertions(+)
>
> diff --git a/libavcodec/bitstream.h b/libavcodec/bitstream.h
> index 539b721..180bf66 100644
> --- a/libavcodec/bitstream.h
> +++ b/libavcodec/bitstream.h
> @@ -377,4 +377,11 @@ static inline int bitstream_decode210(BitstreamContext 
> *bc)
>  return 2 - bitstream_read_bit(bc);
>  }
>
> +/* Read sign bit and flip the sign of the provided value accordingly. */
> +static inline int bitstream_apply_sign(BitstreamContext *bc, int val)
> +{
> +int sign = bitstream_read_signed(bc, 1);
> +return (val ^ sign) - sign;
> +}
> +
>  #endif /* AVCODEC_BITSTREAM_H */
> --

yes, lgtm
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 2/2] msmpeg4: Remove commented-out debug logging code

2016-06-23 Thread Vittorio Giovara
On Thu, Jun 23, 2016 at 8:46 AM, Diego Biurrun  wrote:
> ---
>
> This does not seem worth the ifdef soup to me.
>
>  libavcodec/msmpeg4dec.c | 25 -
>  1 file changed, 25 deletions(-)
>
> diff --git a/libavcodec/msmpeg4dec.c b/libavcodec/msmpeg4dec.c
> index 28187b3..a2d0ad4 100644
> --- a/libavcodec/msmpeg4dec.c
> +++ b/libavcodec/msmpeg4dec.c
> @@ -620,7 +620,6 @@ static int msmpeg4_decode_dc(MpegEncContext * s, int n, 
> int *dir_ptr)
>  return level;
>  }
>
> -//#define ERROR_DETAILS
>  int ff_msmpeg4_decode_block(MpegEncContext * s, int16_t * block,
>int n, int coded, const uint8_t *scan_table)
>  {
> @@ -750,12 +749,6 @@ int ff_msmpeg4_decode_block(MpegEncContext * s, int16_t 
> * block,
>  else level= level * qmul - qadd;
>  i+= run + 1;
>  if(last) i+=192;
> -#ifdef ERROR_DETAILS
> -if(run==66)
> -av_log(s->avctx, AV_LOG_ERROR, "illegal vlc code in ESC3 
> level=%d\n", level);
> -else if((i>62 && i<192) || i>192+63)
> -av_log(s->avctx, AV_LOG_ERROR, "run overflow in ESC3 
> i=%d run=%d level=%d\n", i, run, level);
> -#endif
>  } else {
>  /* second escape */
>  SKIP_BITS(re, &s->gb, 2);
> @@ -763,12 +756,6 @@ int ff_msmpeg4_decode_block(MpegEncContext * s, int16_t 
> * block,
>  i+= run + rl->max_run[run>>7][level/qmul] + run_diff; 
> //FIXME opt indexing
>  level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - 
> SHOW_SBITS(re, &s->gb, 1);
>  LAST_SKIP_BITS(re, &s->gb, 1);
> -#ifdef ERROR_DETAILS
> -if(run==66)
> -av_log(s->avctx, AV_LOG_ERROR, "illegal vlc code in ESC2 
> level=%d\n", level);
> -else if((i>62 && i<192) || i>192+63)
> -av_log(s->avctx, AV_LOG_ERROR, "run overflow in ESC2 
> i=%d run=%d level=%d\n", i, run, level);
> -#endif
>  }
>  } else {
>  /* first escape */
> @@ -778,23 +765,11 @@ int ff_msmpeg4_decode_block(MpegEncContext * s, int16_t 
> * block,
>  level = level + rl->max_level[run>>7][(run-1)&63] * 
> qmul;//FIXME opt indexing
>  level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, 
> &s->gb, 1);
>  LAST_SKIP_BITS(re, &s->gb, 1);
> -#ifdef ERROR_DETAILS
> -if(run==66)
> -av_log(s->avctx, AV_LOG_ERROR, "illegal vlc code in ESC1 
> level=%d\n", level);
> -else if((i>62 && i<192) || i>192+63)
> -av_log(s->avctx, AV_LOG_ERROR, "run overflow in ESC1 
> i=%d run=%d level=%d\n", i, run, level);
> -#endif
>  }
>  } else {
>  i+= run;
>  level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, 
> &s->gb, 1);
>  LAST_SKIP_BITS(re, &s->gb, 1);
> -#ifdef ERROR_DETAILS
> -if(run==66)
> -av_log(s->avctx, AV_LOG_ERROR, "illegal vlc code 
> level=%d\n", level);
> -else if((i>62 && i<192) || i>192+63)
> -av_log(s->avctx, AV_LOG_ERROR, "run overflow i=%d run=%d 
> level=%d\n", i, run, level);
> -#endif
>  }
>  if (i > 62){
>  i-= 192;
> --

how about replacing the #ifdefs with avctx->debug checks
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 1/2] msmpeg4: Remove some broken, commented-out cruft

2016-06-23 Thread Vittorio Giovara
On Thu, Jun 23, 2016 at 8:46 AM, Diego Biurrun  wrote:
> ---
>
> This must have stopped compiling in 2002...
>
>  libavcodec/msmpeg4dec.c | 26 --
>  1 file changed, 26 deletions(-)
>
> diff --git a/libavcodec/msmpeg4dec.c b/libavcodec/msmpeg4dec.c
> index e0472c6..28187b3 100644
> --- a/libavcodec/msmpeg4dec.c
> +++ b/libavcodec/msmpeg4dec.c
> @@ -745,35 +745,9 @@ int ff_msmpeg4_decode_block(MpegEncContext * s, int16_t 
> * block,
>  if(sign) level= -level;
>  }
>
> -#if 0 // waste of time / this will detect very few errors
> -{
> -const int abs_level= FFABS(level);
> -const int run1= run - rl->max_run[last][abs_level] - 
> run_diff;
> -if(abs_level<=MAX_LEVEL && run<=MAX_RUN){
> -if(abs_level <= rl->max_level[last][run]){
> -av_log(s->avctx, AV_LOG_ERROR, "illegal 3. 
> esc, vlc encoding possible\n");
> -return DECODING_AC_LOST;
> -}
> -if(abs_level <= rl->max_level[last][run]*2){
> -av_log(s->avctx, AV_LOG_ERROR, "illegal 3. 
> esc, esc 1 encoding possible\n");
> -return DECODING_AC_LOST;
> -}
> -if(run1>=0 && abs_level <= 
> rl->max_level[last][run1]){
> -av_log(s->avctx, AV_LOG_ERROR, "illegal 3. 
> esc, esc 2 encoding possible\n");
> -return DECODING_AC_LOST;
> -}
> -}
> -}
> -#endif
>  //level = level * qmul + (level>0) * qadd - (level<=0) * 
> qadd ;
>  if (level>0) level= level * qmul + qadd;
>  else level= level * qmul - qadd;
> -#if 0 // waste of time too :(
> -if(level>2048 || level<-2048){
> -av_log(s->avctx, AV_LOG_ERROR, "|level| overflow in 
> 3. esc\n");
> -return DECODING_AC_LOST;
> -}
> -#endif
>  i+= run + 1;
>  if(last) i+=192;
>  #ifdef ERROR_DETAILS
> --

ok
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] Add an OpenH264 decoder

2016-06-23 Thread Vittorio Giovara
On Thu, Jun 23, 2016 at 7:06 AM, Martin Storsjö  wrote:
> While it is less featureful (and slower) than the built-in H264
> decoder, one could potentially want to use it to take advantage
> of the cisco patent license offer.
> ---
> I got a user explicitly requesting this feature, so apparently there
> is (some) demand for it.
>
> The decoder is very simple; it doesn't handle B-frames, so there's
> no decoding delay, and the decoder doesn't allow decoding into
> user-supplied buffers.

Can you add this blurb to a comment at the top of the file? it will
help when we hunt for non-DR1 codecs.
Could you also please mention the requirement for the bsf?

> ---
>  configure   |   2 +
>  libavcodec/Makefile |   1 +
>  libavcodec/allcodecs.c  |   2 +-
>  libavcodec/libopenh264dec.c | 262 
> 
>  4 files changed, 266 insertions(+), 1 deletion(-)
>  create mode 100644 libavcodec/libopenh264dec.c
>

> +state = (*s->decoder)->DecodeFrame2(s->decoder, 
> s->pkt_filtered.data, s->pkt_filtered.size, ptrs, &info);
> +s->pkt_filtered.size = 0;
> +if (state != dsErrorFree) {
> +av_log(avctx, AV_LOG_ERROR, "DecodeFrame2 failed\n");
> +return AVERROR_UNKNOWN;
> +}
> +if (info.iBufferStatus != 1) {
> +av_log(avctx, AV_LOG_DEBUG, "No frame produced\n");
> +continue;
> +}
> +
> +avctx->width = info.UsrData.sSystemBuffer.iWidth;
> +avctx->height = info.UsrData.sSystemBuffer.iHeight;

ff_set_dimensions maybe?

> +
> +AVCodec ff_libopenh264_decoder = {
> +.name   = "libopenh264",
> +.type   = AVMEDIA_TYPE_VIDEO,
> +.id = AV_CODEC_ID_H264,
> +.priv_data_size = sizeof(SVCContext),
> +.init   = svc_decode_init,
> +.decode = svc_decode_frame,
> +.close  = svc_decode_close,
> +.long_name  = NULL_IF_CONFIG_SMALL("OpenH264"),
> +.capabilities   = AV_CODEC_CAP_DELAY, // The decoder itself doesn't have 
> delay, but the BSF might
> +.caps_internal  = FF_CODEC_CAP_SETS_PKT_DTS,

could also set THREADSAFE and INITCLEANUP I believe

-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Re: [libav-devel] [PATCH 03/10] avconv: buffer the packets written while the muxer is not initialized

2016-06-22 Thread Vittorio Giovara
On Tue, Jun 21, 2016 at 1:50 PM, Anton Khirnov  wrote:
> ---
>  avconv.c| 76 
> +++--
>  avconv.h|  7 ++
>  avconv_opt.c| 10 
>  doc/avconv.texi |  9 +++
>  4 files changed, 84 insertions(+), 18 deletions(-)

Change looks good, but the commit log could explain the behavioral
change introduced.
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 01/10] lavfi: set the link hwframes context before configuring the dst input

2016-06-22 Thread Vittorio Giovara
On Tue, Jun 21, 2016 at 1:50 PM, Anton Khirnov  wrote:
> The destination filter might expect the hw frames context to be already
> set (this is the case e.g. for hwdownload).
> ---
>  libavfilter/avfilter.c | 16 
>  1 file changed, 8 insertions(+), 8 deletions(-)

ok i think
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] Simplify some sign detection operations with an intermediate variable

2016-06-21 Thread Vittorio Giovara
On Tue, Jun 21, 2016 at 11:02 AM, Diego Biurrun  wrote:
> ---
>
> I've pulled this out instead of doing it as part of the new bitstream reader 
> port.
>
>  libavcodec/eamad.c |  4 +++-
>  libavcodec/mdec.c  |  4 +++-
>  libavcodec/mpeg12.c|  5 +++--
>  libavcodec/mpeg12dec.c | 30 ++
>  libavcodec/mpeg4videodec.c | 13 +
>  libavcodec/msmpeg4dec.c| 11 +++
>  6 files changed, 43 insertions(+), 24 deletions(-)]

I think ok
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH 1/4] pixdesc: Add aliases to SMPTE color properties

2016-06-21 Thread Vittorio Giovara
Drop ST from names and symbols, it does not add anything distinctive or
descriptive.
---
 libavcodec/options_table.h | 9 ++---
 libavcodec/version.h   | 2 +-
 libavutil/pixdesc.c| 6 +++---
 libavutil/pixfmt.h | 9 ++---
 libavutil/version.h| 2 +-
 5 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index beebe18..6f7fb96 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -435,9 +435,10 @@ static const AVOption avcodec_options[] = {
 {"smpte240m",   "SMPTE 240 M", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTE240M },   INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"film","Film",0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_FILM }, 
   INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"bt2020",  "BT.2020", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_BT2020 
},  INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
-{"smptest428_1", "SMPTE ST 428-1", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTEST428_1 }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
+{"smpte428","SMPTE 428-1", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTE428 },   INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"smpte431","SMPTE 431-2", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTE431 },INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"smpte432","SMPTE 422-1", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTE432 },INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
+{"smptest428_1", "SMPTE 428-1", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTE428 },   INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"color_trc", "color transfer characteristics", OFFSET(color_trc), 
AV_OPT_TYPE_INT, {.i64 = AVCOL_TRC_UNSPECIFIED }, 1, AVCOL_TRC_NB-1, V|E|D, 
"color_trc_type"},
 {"bt709","BT.709",   0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_BT709 },INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"unspecified",  "Unspecified",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_UNSPECIFIED },  INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
@@ -453,9 +454,11 @@ static const AVOption avcodec_options[] = {
 {"iec61966_2_1", "IEC 61966-2-1",0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_IEC61966_2_1 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"bt2020_10bit", "BT.2020 - 10 bit", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_BT2020_10 },INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"bt2020_12bit", "BT.2020 - 12 bit", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_BT2020_12 },INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
-{"smptest2084",  "SMPTE ST 2084",0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_SMPTEST2084 },  INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
-{"smptest428_1", "SMPTE ST 428-1",   0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_SMPTEST428_1 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"smpte2084","SMPTE 2084",   0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_SMPTE2084 },INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"smpte428", "SMPTE 428-1",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_SMPTE428 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"arib-std-b67", "ARIB STD-B67", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_ARIB_STD_B67 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"smptest2084",  "SMPTE 2084",   0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_SMPTE2084 },INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"smptest428_1", "SMPTE 428-1",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_SMPTE428 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"colorspace", "color space", OFFSET(colorspace), AV_OPT_TYPE_INT, {.i64 = 
AVCOL_SPC_UNSPECIFIED }, 0, AVCOL_SPC_NB-1, V|E|D, "colorspace_type"},
 {"rgb", "RGB", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_SPC_RGB },  
   INT_MIN, INT_MAX, V|E|D, "colorspace_type"},
 {"bt709",   "BT.709",  0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_SPC_BT709 
},   INT_MIN, INT_MAX, V|E|D, "colorspace_type"},
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 78f4214..7071ea8 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,7 +29,7 @@
 
 #define LIBAVCODEC_VERSION_MAJOR 57
 #define LIBAVCODEC_VERSION_MINOR 22
-#define LIBAVCODEC_VERSION_MICRO  2
+#define LIBAVCODEC_VERSION_MICRO  3
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index 4e52067..f43f2a8 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -1612,7 +1612,7 @@ static const char *color_primaries_names[] = {
 [AVCOL_PRI_SMPTE240M] = "smpte240m",
 [AVCOL_PRI_FILM] = "film",
 [AVCOL_PRI_BT2020] = "bt2020",
-[AVCOL_PRI_SMPTEST428_1] = "smptest428-1",
+[AVCOL_PRI_SMPTE428] = "smpte428",
 [AVCOL_PRI_SMPTE431] = "smpte431",
 [AVCOL_PRI_SMPTE432] = "smpte432",
 };
@@ -1634,8 +1634,8 @@ static const char *color_transfer_names[]

[libav-devel] [PATCH 3/4] options_table: Add aliases for color properties

2016-06-21 Thread Vittorio Giovara
All option names now match the ones provided by the av_color_*_name().
---
 libavcodec/options_table.h | 32 
 libavcodec/version.h   |  2 +-
 2 files changed, 25 insertions(+), 9 deletions(-)

diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index 6f7fb96..5090806 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -428,7 +428,7 @@ static const AVOption avcodec_options[] = {
 {"ticks_per_frame", NULL, OFFSET(ticks_per_frame), AV_OPT_TYPE_INT, {.i64 = 1 
}, 1, INT_MAX, A|V|E|D},
 {"color_primaries", "color primaries", OFFSET(color_primaries), 
AV_OPT_TYPE_INT, {.i64 = AVCOL_PRI_UNSPECIFIED }, 1, AVCOL_PRI_NB-1, V|E|D, 
"color_primaries_type"},
 {"bt709",   "BT.709",  0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_BT709 
},   INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
-{"unspecified", "Unspecified", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_UNSPECIFIED }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
+{"unknown", "Unspecified", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_UNSPECIFIED }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"bt470m",  "BT.470 M",0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_BT470M 
},  INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"bt470bg", "BT.470 BG",   0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_BT470BG 
}, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"smpte170m",   "SMPTE 170 M", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTE170M },   INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
@@ -438,15 +438,27 @@ static const AVOption avcodec_options[] = {
 {"smpte428","SMPTE 428-1", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTE428 },   INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"smpte431","SMPTE 431-2", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTE431 },INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"smpte432","SMPTE 422-1", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTE432 },INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
+{"unspecified", "Unspecified", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_UNSPECIFIED }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"smptest428_1", "SMPTE 428-1", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTE428 },   INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"color_trc", "color transfer characteristics", OFFSET(color_trc), 
AV_OPT_TYPE_INT, {.i64 = AVCOL_TRC_UNSPECIFIED }, 1, AVCOL_TRC_NB-1, V|E|D, 
"color_trc_type"},
 {"bt709","BT.709",   0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_BT709 },INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
-{"unspecified",  "Unspecified",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_UNSPECIFIED },  INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"unknown",  "Unspecified",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_UNSPECIFIED },  INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"gamma22",  "BT.470 M", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_GAMMA22 },  INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"gamma28",  "BT.470 BG",0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_GAMMA28 },  INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"smpte170m","SMPTE 170 M",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_SMPTE170M },INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"smpte240m","SMPTE 240 M",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_SMPTE240M },INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"linear",   "Linear",   0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_LINEAR },   INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"log100",   "Log",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_LOG },  INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"log316",   "Log square root",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_LOG_SQRT }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"iec61966-2-4", "IEC 61966-2-4",0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_IEC61966_2_4 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"bt1361e",  "BT.1361",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_BT1361_ECG },   INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"iec61966-2-1", "IEC 61966-2-1",0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_IEC61966_2_1 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"bt2020-10","BT.2020 - 10 bit", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_BT2020_10 },INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"bt2020-12","BT.2020 - 12 bit", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_BT2020_12 },INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"smpte2084","SMPTE 2084",   0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_SMPTE2084 },INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"smpte428", "SMPTE 428-1",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_SMPTE428 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"arib-std-b67", "ARIB STD-B67", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_ARIB_STD_B67 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"unspecified",  

[libav-devel] [PATCH 4/4] pixdesc: Add documentation about the main use-case of color name APIs

2016-06-21 Thread Vittorio Giovara
---
 doc/APIchanges  | 6 ++
 libavutil/pixdesc.h | 9 +
 2 files changed, 15 insertions(+)

diff --git a/doc/APIchanges b/doc/APIchanges
index de0213f..712f0b6 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -13,6 +13,12 @@ libavutil: 2015-08-28
 
 API changes, most recent first:
 
+2016-xx-xx - xxx - lavu 55.16.1, lavc 57.22.4
+  Make sure that all values returned fromav_color_primaries_name(),
+  av_color_transfer_name(), av_color_space_name(), av_color_range_name(),
+  and av_chroma_location_name() may be safely used with external command line
+  tools (such as avconv and x264).
+
 2016-xx-xx - xxx - lavc 57.20.0 - avcodec.h
   Add FF_PROFILE_H264_MULTIVIEW_HIGH and FF_PROFILE_H264_STEREO_HIGH.
 
diff --git a/libavutil/pixdesc.h b/libavutil/pixdesc.h
index 3bb10f7..14604cb 100644
--- a/libavutil/pixdesc.h
+++ b/libavutil/pixdesc.h
@@ -294,26 +294,35 @@ enum AVPixelFormat av_pix_fmt_swap_endianness(enum 
AVPixelFormat pix_fmt);
 
 /**
  * @return the name for provided color range or NULL if unknown.
+ * @note the value may be used as-is for the avconv -color_range option.
  */
 const char *av_color_range_name(enum AVColorRange range);
 
 /**
  * @return the name for provided color primaries or NULL if unknown.
+ * @note the value may be used as-is for the avconv -color_primaries,
+ *   and x264 --colorprim options.
  */
 const char *av_color_primaries_name(enum AVColorPrimaries primaries);
 
 /**
  * @return the name for provided color transfer or NULL if unknown.
+ * @note the value may be used as-is for the avconv -color_trc,
+ *   and x264 --transfer options.
  */
 const char *av_color_transfer_name(enum AVColorTransferCharacteristic 
transfer);
 
 /**
  * @return the name for provided color space or NULL if unknown.
+ * @note the value may be used as-is for the avconv -colorspace,
+ *   and x264 --colormatrix options.
  */
 const char *av_color_space_name(enum AVColorSpace space);
 
 /**
  * @return the name for provided chroma location or NULL if unknown.
+ * @note the value may be used as-is for the avconv -chroma_sample_location
+ *   option.
  */
 const char *av_chroma_location_name(enum AVChromaLocation location);
 
-- 
2.9.0

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH 2/4] pixdesc: Fix AVCOL_TRC_BT2020_12 name

2016-06-21 Thread Vittorio Giovara
---
 libavutil/pixdesc.c | 2 +-
 libavutil/version.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index f43f2a8..6d9e38d 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -1633,7 +1633,7 @@ static const char *color_transfer_names[] = {
 [AVCOL_TRC_BT1361_ECG] = "bt1361e",
 [AVCOL_TRC_IEC61966_2_1] = "iec61966-2-1",
 [AVCOL_TRC_BT2020_10] = "bt2020-10",
-[AVCOL_TRC_BT2020_12] = "bt2020-20",
+[AVCOL_TRC_BT2020_12] = "bt2020-12",
 [AVCOL_TRC_SMPTE2084] = "smpte2084",
 [AVCOL_TRC_SMPTE428] = "smpte428",
 [AVCOL_TRC_ARIB_STD_B67] = "arib-std-b67",
diff --git a/libavutil/version.h b/libavutil/version.h
index d13794c..7a01c4e 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -55,7 +55,7 @@
 
 #define LIBAVUTIL_VERSION_MAJOR 55
 #define LIBAVUTIL_VERSION_MINOR 16
-#define LIBAVUTIL_VERSION_MICRO  0
+#define LIBAVUTIL_VERSION_MICRO  1
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
LIBAVUTIL_VERSION_MINOR, \
-- 
2.9.0

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 2/2] truemotion2rt: Convert to the new bitstream reader

2016-06-21 Thread Vittorio Giovara
On Tue, Jun 21, 2016 at 8:42 AM, Diego Biurrun  wrote:
> ---
>  libavcodec/truemotion2rt.c | 16 
>  1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/libavcodec/truemotion2rt.c b/libavcodec/truemotion2rt.c
> index 4d398fb..666111c 100644
> --- a/libavcodec/truemotion2rt.c
> +++ b/libavcodec/truemotion2rt.c
> @@ -29,11 +29,11 @@
>
>  #define BITSTREAM_READER_LE
>  #include "avcodec.h"
> -#include "get_bits.h"
> +#include "bitstream.h"
>  #include "internal.h"
>
>  typedef struct TrueMotion2RTContext {
> -GetBitContext gb;
> +BitstreamContext bc;
>  int delta_size;
>  int hscale;
>  } TrueMotion2RTContext;
> @@ -102,7 +102,7 @@ static int truemotion2rt_decode_frame(AVCodecContext 
> *avctx, void *data,
>  {
>  TrueMotion2RTContext *s = avctx->priv_data;
>  AVFrame * const p = data;
> -GetBitContext *gb = &s->gb;
> +BitstreamContext *bc = &s->bc;
>  uint8_t *dst;
>  int x, y, delta_mode;
>  int ret;
> @@ -111,7 +111,7 @@ static int truemotion2rt_decode_frame(AVCodecContext 
> *avctx, void *data,
>  if (ret < 0)
>  return ret;
>
> -ret = init_get_bits8(gb, avpkt->data + ret, avpkt->size - ret);
> +ret = bitstream_init8(bc, avpkt->data + ret, avpkt->size - ret);
>  if (ret < 0)
>  return ret;
>
> @@ -119,13 +119,13 @@ static int truemotion2rt_decode_frame(AVCodecContext 
> *avctx, void *data,
>  if (ret < 0)
>  return ret;
>
> -skip_bits(gb, 32);
> +bitstream_skip(bc, 32);
>  delta_mode = s->delta_size - 2;
>  dst = p->data[0];
>  for (y = 0; y < avctx->height; y++) {
>  int diff = 0;
>  for (x = 0; x < avctx->width; x += s->hscale) {
> -diff  += delta_tabs[delta_mode][get_bits(gb, s->delta_size)];
> +diff  += delta_tabs[delta_mode][bitstream_read(bc, 
> s->delta_size)];
>  dst[x] = av_clip_uint8((y ? dst[x - p->linesize[0]] : 0) + diff);
>  }
>  dst += p->linesize[0];
> @@ -151,7 +151,7 @@ static int truemotion2rt_decode_frame(AVCodecContext 
> *avctx, void *data,
>  for (y = 0; y < avctx->height >> 2; y++) {
>  int diff = 0;
>  for (x = 0; x < avctx->width >> 2; x += s->hscale) {
> -diff  += delta_tabs[delta_mode][get_bits(gb, s->delta_size)];
> +diff  += delta_tabs[delta_mode][bitstream_read(bc, 
> s->delta_size)];
>  dst[x] = av_clip_uint8((y ? dst[x - p->linesize[1]] : 128) + 
> diff);
>  }
>  dst += p->linesize[1];
> @@ -177,7 +177,7 @@ static int truemotion2rt_decode_frame(AVCodecContext 
> *avctx, void *data,
>  for (y = 0; y < avctx->height >> 2; y++) {
>  int diff = 0;
>  for (x = 0; x < avctx->width >> 2; x += s->hscale) {
> -diff  += delta_tabs[delta_mode][get_bits(gb, s->delta_size)];
> +diff  += delta_tabs[delta_mode][bitstream_read(bc, 
> s->delta_size)];
>  dst[x] = av_clip_uint8((y ? dst[x - p->linesize[2]] : 128) + 
> diff);
>  }
>  dst += p->linesize[2];
> --
> 2.7.3

lgtm
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 1/2] magicyuv: Convert to the new bitstream reader

2016-06-21 Thread Vittorio Giovara
On Tue, Jun 21, 2016 at 8:42 AM, Diego Biurrun  wrote:
> ---
>  libavcodec/magicyuv.c | 33 +
>  1 file changed, 17 insertions(+), 16 deletions(-)
>
> diff --git a/libavcodec/magicyuv.c b/libavcodec/magicyuv.c
> index 310ead4..8dec6bb 100644
> --- a/libavcodec/magicyuv.c
> +++ b/libavcodec/magicyuv.c
> @@ -22,14 +22,15 @@
>  #include 
>  #include 
>
> -#include "../libavutil/pixdesc.h"
> +#include "libavutil/pixdesc.h"
>
>  #include "avcodec.h"
> +#include "bitstream.h"
>  #include "bytestream.h"
> -#include "get_bits.h"
>  #include "huffyuvdsp.h"
>  #include "internal.h"
>  #include "thread.h"
> +#include "vlc.h"
>
>  typedef struct Slice {
>  uint32_t start;
> @@ -108,7 +109,7 @@ static int magy_decode_slice(AVCodecContext *avctx, void 
> *tdata,
>  int interlaced = s->interlaced;
>  AVFrame *p = s->p;
>  int i, k, x;
> -GetBitContext gb;
> +BitstreamContext bc;
>  uint8_t *dst;
>
>  for (i = 0; i < s->planes; i++) {
> @@ -119,20 +120,20 @@ static int magy_decode_slice(AVCodecContext *avctx, 
> void *tdata,
>  ptrdiff_t fake_stride = p->linesize[i] * (1 + interlaced);
>  ptrdiff_t stride = p->linesize[i];
>  int flags, pred;
> -int ret = init_get_bits8(&gb, s->buf + s->slices[i][j].start,
> - s->slices[i][j].size);
> +int ret = bitstream_init8(&bc, s->buf + s->slices[i][j].start,
> +  s->slices[i][j].size);
>
>  if (ret < 0)
>  return ret;
>
> -flags = get_bits(&gb, 8);
> -pred  = get_bits(&gb, 8);
> +flags = bitstream_read(&bc, 8);
> +pred  = bitstream_read(&bc, 8);
>
>  dst = p->data[i] + j * sheight * stride;
>  if (flags & 1) {
>  for (k = 0; k < height; k++) {
>  for (x = 0; x < width; x++)
> -dst[x] = get_bits(&gb, 8);
> +dst[x] = bitstream_read(&bc, 8);
>
>  dst += stride;
>  }
> @@ -140,10 +141,10 @@ static int magy_decode_slice(AVCodecContext *avctx, 
> void *tdata,
>  for (k = 0; k < height; k++) {
>  for (x = 0; x < width; x++) {
>  int pix;
> -if (get_bits_left(&gb) <= 0)
> +if (bitstream_bits_left(&bc) <= 0)
>  return AVERROR_INVALIDDATA;
>
> -pix = get_vlc2(&gb, s->vlc[i].table, s->vlc[i].bits, 3);
> +pix = bitstream_read_vlc(&bc, s->vlc[i].table, 
> s->vlc[i].bits, 3);
>  if (pix < 0)
>  return AVERROR_INVALIDDATA;
>
> @@ -238,7 +239,7 @@ static int magy_decode_frame(AVCodecContext *avctx, void 
> *data,
>  ThreadFrame frame = { .f = data };
>  AVFrame *p = data;
>  GetByteContext gbyte;
> -GetBitContext gbit;
> +BitstreamContext gbit;
>  uint32_t first_offset, offset, next_offset, header_size, slice_width;
>  int width, height, format, version, table_size;
>  int ret, i, j, k;
> @@ -370,16 +371,16 @@ static int magy_decode_frame(AVCodecContext *avctx, 
> void *data,
>  if (table_size < 2)
>  return AVERROR_INVALIDDATA;
>
> -ret = init_get_bits8(&gbit, avpkt->data + bytestream2_tell(&gbyte), 
> table_size);
> +ret = bitstream_init8(&gbit, avpkt->data + bytestream2_tell(&gbyte), 
> table_size);
>  if (ret < 0)
>  return ret;
>
>  memset(s->len, 0, sizeof(s->len));
>  j = i = 0;
> -while (get_bits_left(&gbit) >= 8) {
> -int b = get_bits(&gbit, 4);
> -int x = get_bits(&gbit, 4);
> -int l = get_bitsz(&gbit, b) + 1;
> +while (bitstream_bits_left(&gbit) >= 8) {
> +int b = bitstream_read(&gbit, 4);
> +int x = bitstream_read(&gbit, 4);
> +int l = bitstream_read(&gbit, b) + 1;
>
>  for (k = 0; k < l; k++)
>  if (j + k < 256)
> --

lgtm
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH] truemotion2rt: Use ff_set_dimensions

2016-06-21 Thread Vittorio Giovara
---
 libavcodec/truemotion2rt.c | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/libavcodec/truemotion2rt.c b/libavcodec/truemotion2rt.c
index 4d398fb..ed7fb68 100644
--- a/libavcodec/truemotion2rt.c
+++ b/libavcodec/truemotion2rt.c
@@ -63,7 +63,8 @@ static int truemotion2rt_decode_header(AVCodecContext *avctx, 
AVPacket *avpkt)
 uint8_t header_buffer[128] = { 0 };  /* logical maximum header size */
 const uint8_t *buf = avpkt->data;
 int size = avpkt->size;
-int i;
+int width, height;
+int ret, i;
 
 if (size < 1) {
 av_log(avctx, AV_LOG_ERROR, "input packet too small (%d)\n", size);
@@ -90,8 +91,12 @@ static int truemotion2rt_decode_header(AVCodecContext 
*avctx, AVPacket *avpkt)
 if (s->delta_size < 2 || s->delta_size > 4)
 return AVERROR_INVALIDDATA;
 
-avctx->height = AV_RL16(header_buffer + 5);
-avctx->width  = AV_RL16(header_buffer + 7);
+height = AV_RL16(header_buffer + 5);
+width  = AV_RL16(header_buffer + 7);
+
+ret = ff_set_dimensions(avctx, width, height);
+if (ret < 0)
+return ret;
 
 av_log(avctx, AV_LOG_DEBUG, "Header size: %d\n", header_size);
 return header_size;
-- 
2.9.0

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 4/5] options_table: Add aliases for color properties

2016-06-20 Thread Vittorio Giovara
On Wed, Jun 15, 2016 at 2:54 PM, Luca Barbato  wrote:
> On 15/06/16 20:25, Vittorio Giovara wrote:
>> All option names now match the ones provided by the av_color_*_name().
>> ---
>> Needs lavc micro version bump
>>  libavcodec/options_table.h | 27 ++-
>>  1 file changed, 22 insertions(+), 5 deletions(-)
>>
>
> Sure.

I missed an entry for chroma location, so unless objections I'd squash this in

diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index b849bb3..735f91c 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -487,13 +487,14 @@ static const AVOption avcodec_options[] = {
 {"mpeg", "MPEG (219*2^(n-8))", 0, AV_OPT_TYPE_CONST, {.i64 =
AVCOL_RANGE_MPEG },INT_MIN, INT_MAX, V|E|D,
"color_range_type"},
 {"jpeg", "JPEG (2^n-1)",   0, AV_OPT_TYPE_CONST, {.i64 =
AVCOL_RANGE_JPEG },INT_MIN, INT_MAX, V|E|D,
"color_range_type"},
 {"chroma_sample_location", "chroma sample location",
OFFSET(chroma_sample_location), AV_OPT_TYPE_INT, {.i64 =
AVCHROMA_LOC_UNSPECIFIED }, 0, AVCHROMA_LOC_NB-1, V|E|D,
"chroma_sample_location_type"},
-{"unspecified", "Unspecified", 0, AV_OPT_TYPE_CONST, {.i64 =
AVCHROMA_LOC_UNSPECIFIED }, INT_MIN, INT_MAX, V|E|D,
"chroma_sample_location_type"},
+{"unknown", "Unspecified", 0, AV_OPT_TYPE_CONST, {.i64 =
AVCHROMA_LOC_UNSPECIFIED }, INT_MIN, INT_MAX, V|E|D,
"chroma_sample_location_type"},
 {"left","Left",0, AV_OPT_TYPE_CONST, {.i64 =
AVCHROMA_LOC_LEFT },INT_MIN, INT_MAX, V|E|D,
"chroma_sample_location_type"},
 {"center",  "Center",  0, AV_OPT_TYPE_CONST, {.i64 =
AVCHROMA_LOC_CENTER },  INT_MIN, INT_MAX, V|E|D,
"chroma_sample_location_type"},
 {"topleft", "Top-left",0, AV_OPT_TYPE_CONST, {.i64 =
AVCHROMA_LOC_TOPLEFT }, INT_MIN, INT_MAX, V|E|D,
"chroma_sample_location_type"},
 {"top", "Top", 0, AV_OPT_TYPE_CONST, {.i64 =
AVCHROMA_LOC_TOP }, INT_MIN, INT_MAX, V|E|D,
"chroma_sample_location_type"},
 {"bottomleft",  "Bottom-left", 0, AV_OPT_TYPE_CONST, {.i64 =
AVCHROMA_LOC_BOTTOMLEFT },  INT_MIN, INT_MAX, V|E|D,
"chroma_sample_location_type"},
 {"bottom",  "Bottom",  0, AV_OPT_TYPE_CONST, {.i64 =
AVCHROMA_LOC_BOTTOM },  INT_MIN, INT_MAX, V|E|D,
"chroma_sample_location_type"},
+{"unspecified", "Unspecified", 0, AV_OPT_TYPE_CONST, {.i64 =
AVCHROMA_LOC_UNSPECIFIED }, INT_MIN, INT_MAX, V|E|D,
"chroma_sample_location_type"},
 {"log_level_offset", "set the log level offset",
OFFSET(log_level_offset), AV_OPT_TYPE_INT, {.i64 = 0 }, INT_MIN,
INT_MAX },
 {"slices", "number of slices, used in parallelized encoding",
OFFSET(slices), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, V|E},
 {"thread_type", "select multithreading type", OFFSET(thread_type),
AV_OPT_TYPE_FLAGS, {.i64 = FF_THREAD_SLICE|FF_THREAD_FRAME }, 0,
INT_MAX, V|E|D, "thread_type"},


-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH] pixdesc: Add documentation about the main use-case of color name APIs

2016-06-20 Thread Vittorio Giovara
---
More documentation about this change as requested.
Vittorio

 doc/APIchanges  | 6 ++
 libavutil/pixdesc.h | 8 
 2 files changed, 14 insertions(+)

diff --git a/doc/APIchanges b/doc/APIchanges
index de0213f..050c897 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -13,6 +13,12 @@ libavutil: 2015-08-28
 
 API changes, most recent first:
 
+2016-xx-xx - xxx - lavu 55.15.0, lavc 57.22.2
+  Make sure av_color_primaries_name(), av_color_transfer_name(),
+  av_color_space_name(), av_color_range_name(), and av_chroma_location_name()
+  respect the original intent of reusability with external command line
+  tools (avconv and x264).
+
 2016-xx-xx - xxx - lavc 57.20.0 - avcodec.h
   Add FF_PROFILE_H264_MULTIVIEW_HIGH and FF_PROFILE_H264_STEREO_HIGH.
 
diff --git a/libavutil/pixdesc.h b/libavutil/pixdesc.h
index 3bb10f7..b02f631 100644
--- a/libavutil/pixdesc.h
+++ b/libavutil/pixdesc.h
@@ -294,26 +294,34 @@ enum AVPixelFormat av_pix_fmt_swap_endianness(enum 
AVPixelFormat pix_fmt);
 
 /**
  * @return the name for provided color range or NULL if unknown.
+ * @note the value may be used as-is for avconv -color_range option.
  */
 const char *av_color_range_name(enum AVColorRange range);
 
 /**
  * @return the name for provided color primaries or NULL if unknown.
+ * @note the value may be used as-is for avconv -color_primaries,
+ *   and x264 --colorprim options.
  */
 const char *av_color_primaries_name(enum AVColorPrimaries primaries);
 
 /**
  * @return the name for provided color transfer or NULL if unknown.
+ * @note the value may be used as-is for avconv -color_trc,
+ *   and x264 --transfer options.
  */
 const char *av_color_transfer_name(enum AVColorTransferCharacteristic 
transfer);
 
 /**
  * @return the name for provided color space or NULL if unknown.
+ * @note the value may be used as-is for avconv -colorspace,
+ *   and x264 --colormatrix options.
  */
 const char *av_color_space_name(enum AVColorSpace space);
 
 /**
  * @return the name for provided chroma location or NULL if unknown.
+ * @note the value may be used as-is for avconv -chroma_sample_location.
  */
 const char *av_chroma_location_name(enum AVChromaLocation location);
 
-- 
2.8.3

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] Add MagicYUV decoder

2016-06-20 Thread Vittorio Giovara
On Sun, Jun 19, 2016 at 9:33 AM, Luca Barbato  wrote:
> On 19/06/16 00:23, Vittorio Giovara wrote:
>> From: Paul B Mahol 
>>
>> Signed-off-by: Paul B Mahol 
>> Signed-off-by: Vittorio Giovara 
>> ---
>>  Changelog   |   1 +
>>  configure   |   1 +
>>  doc/general.texi|   1 +
>>  libavcodec/Makefile |   1 +
>>  libavcodec/allcodecs.c  |   1 +
>>  libavcodec/avcodec.h|   1 +
>>  libavcodec/codec_desc.c |   7 +
>>  libavcodec/magicyuv.c   | 484 
>> 
>>  libavformat/isom.c  |   8 +
>>  libavformat/riff.c  |   1 +
>>  10 files changed, 506 insertions(+)
>>  create mode 100644 libavcodec/magicyuv.c
>>
>
> Possibly OK.

i was thinking of adding

diff --git a/libavcodec/magicyuv.c b/libavcodec/magicyuv.c
index accd128..310ead4 100644
--- a/libavcodec/magicyuv.c
+++ b/libavcodec/magicyuv.c
@@ -22,6 +22,8 @@
 #include 
 #include 

+#include "../libavutil/pixdesc.h"
+
 #include "avcodec.h"
 #include "bytestream.h"
 #include "get_bits.h"
@@ -269,26 +271,21 @@ static int magy_decode_frame(AVCodecContext
*avctx, void *data,
 case 0x65:
 avctx->pix_fmt = AV_PIX_FMT_GBRP;
 s->decorrelate = 1;
-s->planes = 3;
 break;
 case 0x66:
 avctx->pix_fmt = AV_PIX_FMT_GBRAP;
 s->decorrelate = 1;
-s->planes = 4;
 break;
 case 0x67:
 avctx->pix_fmt = AV_PIX_FMT_YUV444P;
-s->planes = 3;
 break;
 case 0x68:
 avctx->pix_fmt = AV_PIX_FMT_YUV422P;
-s->planes = 3;
 s->hshift[1] =
 s->hshift[2] = 1;
 break;
 case 0x69:
 avctx->pix_fmt = AV_PIX_FMT_YUV420P;
-s->planes = 3;
 s->hshift[1] =
 s->vshift[1] =
 s->hshift[2] =
@@ -296,16 +293,15 @@ static int magy_decode_frame(AVCodecContext
*avctx, void *data,
 break;
 case 0x6a:
 avctx->pix_fmt = AV_PIX_FMT_YUVA444P;
-s->planes = 4;
 break;
 case 0x6b:
 avctx->pix_fmt = AV_PIX_FMT_GRAY8;
-s->planes = 1;
 break;
 default:
 avpriv_request_sample(avctx, "Format 0x%X", format);
 return AVERROR_PATCHWELCOME;
 }
+s->planes = av_pix_fmt_count_planes(avctx->pix_fmt);

 bytestream2_skip(&gbyte, 2);
 s->interlaced = !!(bytestream2_get_byte(&gbyte) & 2);


is it still ok?
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 2/5] pixdesc: Make sure color properties names match x264

2016-06-20 Thread Vittorio Giovara
On Thu, Jun 16, 2016 at 1:27 PM, Vittorio Giovara
 wrote:
> On Thu, Jun 16, 2016 at 1:09 PM, Luca Barbato  wrote:
>> On 16/06/16 18:56, Vittorio Giovara wrote:
>>> The symbols with the unfortunate name were added in 4a66422 (17 Sep
>>> 2015), they were not part of the 11 release, nor is the API in
>>> question ever released in any libav release.
>>
>> Then we can change it as you like IMO.
>
> Sure, I just hope the message conveyed is not "because I like it" but
> rather "because it makes sense to do".
> --
> Vittorio

Any more comments on this set? Perhaps should I add a note in the
functions documentation?
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH] Add MagicYUV decoder

2016-06-18 Thread Vittorio Giovara
From: Paul B Mahol 

Signed-off-by: Paul B Mahol 
Signed-off-by: Vittorio Giovara 
---
 Changelog   |   1 +
 configure   |   1 +
 doc/general.texi|   1 +
 libavcodec/Makefile |   1 +
 libavcodec/allcodecs.c  |   1 +
 libavcodec/avcodec.h|   1 +
 libavcodec/codec_desc.c |   7 +
 libavcodec/magicyuv.c   | 484 
 libavformat/isom.c  |   8 +
 libavformat/riff.c  |   1 +
 10 files changed, 506 insertions(+)
 create mode 100644 libavcodec/magicyuv.c

diff --git a/Changelog b/Changelog
index a2a9d46..a3f5376 100644
--- a/Changelog
+++ b/Changelog
@@ -57,6 +57,7 @@ version :
 - Generic OpenMAX IL encoder with support for Raspberry Pi
 - MMAL-accelerated MPEG-2 and VC-1 decoding
 - G.729 raw demuxer
+- MagicYUV decoder
 
 
 version 11:
diff --git a/configure b/configure
index e68cd3e..0066cff 100755
--- a/configure
+++ b/configure
@@ -1984,6 +1984,7 @@ jv_decoder_select="blockdsp"
 lagarith_decoder_select="huffyuvdsp"
 ljpeg_encoder_select="aandcttables idctdsp jpegtables"
 loco_decoder_select="golomb"
+magicyuv_decoder_select="huffyuvdsp"
 mdec_decoder_select="blockdsp idctdsp mpegvideo"
 metasound_decoder_select="lsp mdct sinewin"
 mimic_decoder_select="blockdsp bswapdsp hpeldsp idctdsp"
diff --git a/doc/general.texi b/doc/general.texi
index 15e4a66..a6a6db6 100644
--- a/doc/general.texi
+++ b/doc/general.texi
@@ -672,6 +672,7 @@ following image formats are supported:
 @item LucasArts SANM @tab @tab  X
 @tab Used in LucasArts SMUSH animations.
 @item lossless MJPEG @tab  X  @tab  X
+@item MagicYUV Lossless Video @tab@tab  X
 @item Microsoft ATC Screen   @tab @tab  X
 @tab Also known as Microsoft Screen 3.
 @item Microsoft Expression Encoder Screen  @tab @tab  X
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index c9b2b74..8352c97 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -298,6 +298,7 @@ OBJS-$(CONFIG_LJPEG_ENCODER)   += ljpegenc.o 
mjpegenc_common.o
 OBJS-$(CONFIG_LOCO_DECODER)+= loco.o
 OBJS-$(CONFIG_MACE3_DECODER)   += mace.o
 OBJS-$(CONFIG_MACE6_DECODER)   += mace.o
+OBJS-$(CONFIG_MAGICYUV_DECODER)+= magicyuv.o
 OBJS-$(CONFIG_MDEC_DECODER)+= mdec.o mpeg12.o mpeg12data.o
 OBJS-$(CONFIG_METASOUND_DECODER)   += metasound.o metasound_data.o \
   twinvq.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 2b11ef6..bb90627 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -191,6 +191,7 @@ void avcodec_register_all(void)
 REGISTER_DECODER(LAGARITH,  lagarith);
 REGISTER_ENCODER(LJPEG, ljpeg);
 REGISTER_DECODER(LOCO,  loco);
+REGISTER_DECODER(MAGICYUV,  magicyuv);
 REGISTER_DECODER(MDEC,  mdec);
 REGISTER_DECODER(MIMIC, mimic);
 REGISTER_ENCDEC (MJPEG, mjpeg);
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index b03d0b8..623d743 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -389,6 +389,7 @@ enum AVCodecID {
 AV_CODEC_ID_DXV,
 AV_CODEC_ID_SCREENPRESSO,
 AV_CODEC_ID_RSCC,
+AV_CODEC_ID_MAGICYUV,
 
 /* various PCM "codecs" */
 AV_CODEC_ID_FIRST_AUDIO = 0x1, ///< A dummy id pointing at the 
start of audio codecs
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index 7fd2cc6..d390e72 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -1191,6 +1191,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
 .long_name = NULL_IF_CONFIG_SMALL("innoHeim/Rsupport Screen Capture 
Codec"),
 .props = AV_CODEC_PROP_LOSSLESS,
 },
+{
+.id= AV_CODEC_ID_MAGICYUV,
+.type  = AVMEDIA_TYPE_VIDEO,
+.name  = "magicyuv",
+.long_name = NULL_IF_CONFIG_SMALL("MagicYUV video"),
+.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
+},
 
 /* image codecs */
 {
diff --git a/libavcodec/magicyuv.c b/libavcodec/magicyuv.c
new file mode 100644
index 000..accd128
--- /dev/null
+++ b/libavcodec/magicyuv.c
@@ -0,0 +1,484 @@
+/*
+ * MagicYUV decoder
+ * Copyright (c) 2016 Paul B Mahol
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+

Re: [libav-devel] [PATCH] Add MagicYUV decoder

2016-06-18 Thread Vittorio Giovara
On Fri, Jun 17, 2016 at 1:45 PM, Diego Biurrun  wrote:
> On Fri, Jun 17, 2016 at 12:10:31PM -0400, Vittorio Giovara wrote:
>> On Fri, Jun 17, 2016 at 10:20 AM, Diego Biurrun  wrote:
>> > On Mon, Jun 06, 2016 at 12:31:56PM -0400, Vittorio Giovara wrote:
>> >> --- /dev/null
>> >> +++ b/libavcodec/magicyuv.c
>> >> @@ -0,0 +1,469 @@
>> >> +
>> >> +static int magy_decode_slice(AVCodecContext *avctx, void *tdata,
>> >> + int j, int threadnr)
>> >> +{
>> >> +int fake_stride = p->linesize[i] * (1 + interlaced);
>> >> +int stride = p->linesize[i];
>> >
>> > Strides should be ptrdiff_t; not sure here when frame.linesize is int
>> > already.
>>
>> I changed it anyway.
>>
>> >> +for (i = 0; i < s->planes; i++) {
>> >> +av_fast_malloc(&s->slices[i], (unsigned *)&s->slices_size[i], 
>> >> s->nb_slices * sizeof(Slice));
>> >
>> > Do you need the cast?
>>
>> yeah, av_fast_malloc needs unsigned int * there, and this element type
>> was changed to size_t in the previous iteration.
>
> Not sure if it's worth it then. av_fast_*alloc should really use size_t
> and not unsigned int, *sigh* ..

I'll revert and use unsigned int until someone does not break the api ;)
Also I have to change slice_height to int (or is ssize_t better?)
because it's later used for signed operations and breaks on 32bits
otherwise.
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] ffv1: Error out on unsupported format

2016-06-17 Thread Vittorio Giovara
On Thu, Jun 16, 2016 at 10:44 AM, Luca Barbato  wrote:
> From: Jerome Martinez 
>
> Transparency is supported only by YUV and within specific bit depths.
> ---
>
> Eventually had a look, added a similar block for the other colorspace as well.
>
>  libavcodec/ffv1dec.c | 11 +++
>  1 file changed, 11 insertions(+)

I suppose that's ok.
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH] Add MagicYUV decoder

2016-06-17 Thread Vittorio Giovara
From: Paul B Mahol 

Signed-off-by: Paul B Mahol 
Signed-off-by: Vittorio Giovara 
---
In this version
- correct handling of raw slices
- added size checks
- any additional review comment
Vittorio

 Changelog   |   1 +
 configure   |   1 +
 doc/general.texi|   1 +
 libavcodec/Makefile |   1 +
 libavcodec/allcodecs.c  |   1 +
 libavcodec/avcodec.h|   1 +
 libavcodec/codec_desc.c |   7 +
 libavcodec/magicyuv.c   | 484 
 libavformat/isom.c  |   8 +
 libavformat/riff.c  |   1 +
 10 files changed, 506 insertions(+)
 create mode 100644 libavcodec/magicyuv.c

diff --git a/Changelog b/Changelog
index a2a9d46..a3f5376 100644
--- a/Changelog
+++ b/Changelog
@@ -57,6 +57,7 @@ version :
 - Generic OpenMAX IL encoder with support for Raspberry Pi
 - MMAL-accelerated MPEG-2 and VC-1 decoding
 - G.729 raw demuxer
+- MagicYUV decoder
 
 
 version 11:
diff --git a/configure b/configure
index e68cd3e..0066cff 100755
--- a/configure
+++ b/configure
@@ -1984,6 +1984,7 @@ jv_decoder_select="blockdsp"
 lagarith_decoder_select="huffyuvdsp"
 ljpeg_encoder_select="aandcttables idctdsp jpegtables"
 loco_decoder_select="golomb"
+magicyuv_decoder_select="huffyuvdsp"
 mdec_decoder_select="blockdsp idctdsp mpegvideo"
 metasound_decoder_select="lsp mdct sinewin"
 mimic_decoder_select="blockdsp bswapdsp hpeldsp idctdsp"
diff --git a/doc/general.texi b/doc/general.texi
index 15e4a66..a6a6db6 100644
--- a/doc/general.texi
+++ b/doc/general.texi
@@ -672,6 +672,7 @@ following image formats are supported:
 @item LucasArts SANM @tab @tab  X
 @tab Used in LucasArts SMUSH animations.
 @item lossless MJPEG @tab  X  @tab  X
+@item MagicYUV Lossless Video @tab@tab  X
 @item Microsoft ATC Screen   @tab @tab  X
 @tab Also known as Microsoft Screen 3.
 @item Microsoft Expression Encoder Screen  @tab @tab  X
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index c9b2b74..8352c97 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -298,6 +298,7 @@ OBJS-$(CONFIG_LJPEG_ENCODER)   += ljpegenc.o 
mjpegenc_common.o
 OBJS-$(CONFIG_LOCO_DECODER)+= loco.o
 OBJS-$(CONFIG_MACE3_DECODER)   += mace.o
 OBJS-$(CONFIG_MACE6_DECODER)   += mace.o
+OBJS-$(CONFIG_MAGICYUV_DECODER)+= magicyuv.o
 OBJS-$(CONFIG_MDEC_DECODER)+= mdec.o mpeg12.o mpeg12data.o
 OBJS-$(CONFIG_METASOUND_DECODER)   += metasound.o metasound_data.o \
   twinvq.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 2b11ef6..bb90627 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -191,6 +191,7 @@ void avcodec_register_all(void)
 REGISTER_DECODER(LAGARITH,  lagarith);
 REGISTER_ENCODER(LJPEG, ljpeg);
 REGISTER_DECODER(LOCO,  loco);
+REGISTER_DECODER(MAGICYUV,  magicyuv);
 REGISTER_DECODER(MDEC,  mdec);
 REGISTER_DECODER(MIMIC, mimic);
 REGISTER_ENCDEC (MJPEG, mjpeg);
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index b03d0b8..623d743 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -389,6 +389,7 @@ enum AVCodecID {
 AV_CODEC_ID_DXV,
 AV_CODEC_ID_SCREENPRESSO,
 AV_CODEC_ID_RSCC,
+AV_CODEC_ID_MAGICYUV,
 
 /* various PCM "codecs" */
 AV_CODEC_ID_FIRST_AUDIO = 0x1, ///< A dummy id pointing at the 
start of audio codecs
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index 7fd2cc6..d390e72 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -1191,6 +1191,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
 .long_name = NULL_IF_CONFIG_SMALL("innoHeim/Rsupport Screen Capture 
Codec"),
 .props = AV_CODEC_PROP_LOSSLESS,
 },
+{
+.id= AV_CODEC_ID_MAGICYUV,
+.type  = AVMEDIA_TYPE_VIDEO,
+.name  = "magicyuv",
+.long_name = NULL_IF_CONFIG_SMALL("MagicYUV video"),
+.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
+},
 
 /* image codecs */
 {
diff --git a/libavcodec/magicyuv.c b/libavcodec/magicyuv.c
new file mode 100644
index 000..1cf4d38
--- /dev/null
+++ b/libavcodec/magicyuv.c
@@ -0,0 +1,484 @@
+/*
+ * MagicYUV decoder
+ * Copyright (c) 2016 Paul B Mahol
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or

[libav-devel] [PATCH] Add TrueMotion 2.0 Real Time decoder

2016-06-17 Thread Vittorio Giovara
From: Paul B Mahol 

Signed-off-by: Paul B Mahol 
Signed-off-by: Vittorio Giovara 
---
Addressed Luca's and Diego's comments.
Vittorio

 Changelog  |   1 +
 doc/general.texi   |   2 +
 libavcodec/Makefile|   1 +
 libavcodec/allcodecs.c |   1 +
 libavcodec/avcodec.h   |   1 +
 libavcodec/codec_desc.c|   7 ++
 libavcodec/truemotion2rt.c | 225 +
 libavformat/riff.c |   1 +
 8 files changed, 239 insertions(+)
 create mode 100644 libavcodec/truemotion2rt.c

diff --git a/Changelog b/Changelog
index a3f5376..ac4c725 100644
--- a/Changelog
+++ b/Changelog
@@ -58,6 +58,7 @@ version :
 - MMAL-accelerated MPEG-2 and VC-1 decoding
 - G.729 raw demuxer
 - MagicYUV decoder
+- Duck TrueMotion 2.0 Real Time decoder
 
 
 version 11:
diff --git a/doc/general.texi b/doc/general.texi
index a6a6db6..0590c23 100644
--- a/doc/general.texi
+++ b/doc/general.texi
@@ -607,6 +607,8 @@ following image formats are supported:
 @tab fourcc: DUCK
 @item Duck TrueMotion 2.0@tab @tab  X
 @tab fourcc: TM20
+@item Duck TrueMotion 2.0 RT @tab @tab  X
+@tab fourcc: TR20
 @item DV (Digital Video) @tab  X  @tab  X
 @item Dxtory capture format  @tab @tab  X
 @item Feeble Files/ScummVM DXA  @tab @tab  X
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 8352c97..1f2096c 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -438,6 +438,7 @@ OBJS-$(CONFIG_TIFF_ENCODER)+= tiffenc.o rle.o 
lzwenc.o
 OBJS-$(CONFIG_TMV_DECODER) += tmv.o cga_data.o
 OBJS-$(CONFIG_TRUEMOTION1_DECODER) += truemotion1.o
 OBJS-$(CONFIG_TRUEMOTION2_DECODER) += truemotion2.o
+OBJS-$(CONFIG_TRUEMOTION2RT_DECODER)   += truemotion2rt.o
 OBJS-$(CONFIG_TRUESPEECH_DECODER)  += truespeech.o
 OBJS-$(CONFIG_TSCC_DECODER)+= tscc.o msrledec.o
 OBJS-$(CONFIG_TSCC2_DECODER)   += tscc2.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index bb90627..6fa1617 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -265,6 +265,7 @@ void avcodec_register_all(void)
 REGISTER_DECODER(TMV,   tmv);
 REGISTER_DECODER(TRUEMOTION1,   truemotion1);
 REGISTER_DECODER(TRUEMOTION2,   truemotion2);
+REGISTER_DECODER(TRUEMOTION2RT, truemotion2rt);
 REGISTER_DECODER(TSCC,  tscc);
 REGISTER_DECODER(TSCC2, tscc2);
 REGISTER_DECODER(TXD,   txd);
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 623d743..c4bf708 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -390,6 +390,7 @@ enum AVCodecID {
 AV_CODEC_ID_SCREENPRESSO,
 AV_CODEC_ID_RSCC,
 AV_CODEC_ID_MAGICYUV,
+AV_CODEC_ID_TRUEMOTION2RT,
 
 /* various PCM "codecs" */
 AV_CODEC_ID_FIRST_AUDIO = 0x1, ///< A dummy id pointing at the 
start of audio codecs
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index d390e72..78d2cbc 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -1198,6 +1198,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
 .long_name = NULL_IF_CONFIG_SMALL("MagicYUV video"),
 .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
 },
+{
+.id= AV_CODEC_ID_TRUEMOTION2RT,
+.type  = AVMEDIA_TYPE_VIDEO,
+.name  = "truemotion2rt",
+.long_name = NULL_IF_CONFIG_SMALL("Duck TrueMotion 2.0 Real Time"),
+.props = AV_CODEC_PROP_LOSSY,
+},
 
 /* image codecs */
 {
diff --git a/libavcodec/truemotion2rt.c b/libavcodec/truemotion2rt.c
new file mode 100644
index 000..4d398fb
--- /dev/null
+++ b/libavcodec/truemotion2rt.c
@@ -0,0 +1,225 @@
+/*
+ * Duck TrueMotion 2.0 Real Time decoder
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include 
+#include 
+#include 
+
+#include "libavutil/imgutils.h"
+#include "libavutil/internal.h"
+#include "libavutil/intreadwrite.h"
+#include "libavutil/mem.h"
+
+#define BITSTREAM_READER_LE
+#include "avcodec.h"
+#include "get_bits.h"
+#include "internal.h"
+
+typedef st

Re: [libav-devel] [PATCH] Add MagicYUV decoder

2016-06-17 Thread Vittorio Giovara
On Fri, Jun 17, 2016 at 8:32 AM, Anton Khirnov  wrote:
> Quoting Vittorio Giovara (2016-06-06 18:31:56)
>> From: Paul B Mahol 
>>
>> +s->slice_height = bytestream2_get_le32(&gbyte);
>> +if ((s->slice_height <= 0) || (s->slice_height > INT_MAX - 
>> avctx->coded_height)) {
>> +av_log(avctx, AV_LOG_ERROR,
>> +   "invalid slice height: %ld\n", s->slice_height);
>> +return AVERROR_INVALIDDATA;
>> +}
>> +
>> +bytestream2_skip(&gbyte, 4);
>> +
>> +s->nb_slices = (avctx->coded_height + s->slice_height - 1) / 
>> s->slice_height;
>
> You're not checking that the number of slices is larger than zero (or
> equivalently that the coded height is non-zero).
>
> Also, are the non-coded dimensions ever set?

No, I changed the code above this block to use ff_set_dimensions which
should address both points.

>> +if (s->nb_slices > INT_MAX / sizeof(Slice)) {
>> +av_log(avctx, AV_LOG_ERROR,
>> +   "invalid number of slices: %d\n", s->nb_slices);
>> +return AVERROR_INVALIDDATA;
>> +}
>> +
>> +for (i = 0; i < s->planes; i++) {
>> +av_fast_malloc(&s->slices[i], (unsigned *)&s->slices_size[i], 
>> s->nb_slices * sizeof(Slice));
>> +if (!s->slices[i])
>> +return AVERROR(ENOMEM);
>> +
>> +offset = bytestream2_get_le32(&gbyte);
>> +if (offset >= avpkt->size - header_size)
>> +return AVERROR_INVALIDDATA;
>> +
>> +if (i == 0)
>> +first_offset = offset;
>> +
>> +for (j = 0; j < s->nb_slices - 1; j++) {
>> +s->slices[i][j].start = offset + header_size;
>> +next_offset = bytestream2_get_le32(&gbyte);
>
> You should check that this is larger than the previous offset here. And
> probably move the check from the end of the loop here as well.

ok
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] Add MagicYUV decoder

2016-06-17 Thread Vittorio Giovara
On Fri, Jun 17, 2016 at 10:20 AM, Diego Biurrun  wrote:
> On Mon, Jun 06, 2016 at 12:31:56PM -0400, Vittorio Giovara wrote:
>> --- a/doc/general.texi
>> +++ b/doc/general.texi
>> @@ -672,6 +672,7 @@ following image formats are supported:
>>  @item lossless MJPEG @tab  X  @tab  X
>> +@item MagicYUV Lossless Video @tab@tab  X
>>  @item Microsoft ATC Screen   @tab @tab  X
>> --- a/libavcodec/codec_desc.c
>> +++ b/libavcodec/codec_desc.c
>> @@ -1191,6 +1191,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
>> +.id= AV_CODEC_ID_MAGICYUV,
>> +.type  = AVMEDIA_TYPE_VIDEO,
>> +.name  = "magicyuv",
>> +.long_name = NULL_IF_CONFIG_SMALL("MagicYUV Lossless Video"),
>> --- /dev/null
>> +++ b/libavcodec/magicyuv.c
>> @@ -0,0 +1,469 @@
>> +AVCodec ff_magicyuv_decoder = {
>> +.name = "magicyuv",
>> +.long_name= NULL_IF_CONFIG_SMALL("MagicYUV Lossless Video"),
>> +.type = AVMEDIA_TYPE_VIDEO,
>
> Is the capitalized "Lossless Video" part of the name?  Otherwise it's a
> tad odd.

renamed to MagicYUV video

>> --- /dev/null
>> +++ b/libavcodec/magicyuv.c
>> @@ -0,0 +1,469 @@
>> +
>> +static int magy_decode_slice(AVCodecContext *avctx, void *tdata,
>> + int j, int threadnr)
>> +{
>> +int fake_stride = p->linesize[i] * (1 + interlaced);
>> +int stride = p->linesize[i];
>
> Strides should be ptrdiff_t; not sure here when frame.linesize is int
> already.

I changed it anyway.

>> +for (i = 0; i < s->planes; i++) {
>> +av_fast_malloc(&s->slices[i], (unsigned *)&s->slices_size[i], 
>> s->nb_slices * sizeof(Slice));
>
> Do you need the cast?

yeah, av_fast_malloc needs unsigned int * there, and this element type
was changed to size_t in the previous iteration.
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] mov: handle files which do not have stsc data

2016-06-16 Thread Vittorio Giovara
On Thu, Jun 16, 2016 at 3:19 PM, Luca Barbato  wrote:
> On 16/06/16 21:17, Vittorio Giovara wrote:
>> ---
>>  libavformat/mov.c | 28 +++-
>>  1 file changed, 15 insertions(+), 13 deletions(-)
>>
>> To be squashed in the mov patch (3/5)
>> Vittorio
>>
>
> Do we have samples for that? (Patch Ok)

yep, it's in fate (vc1-ism)
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH] mov: handle files which do not have stsc data

2016-06-16 Thread Vittorio Giovara
---
 libavformat/mov.c | 28 +++-
 1 file changed, 15 insertions(+), 13 deletions(-)

To be squashed in the mov patch (3/5)
Vittorio

diff --git a/libavformat/mov.c b/libavformat/mov.c
index be09373..fe1f264 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -3674,19 +3674,21 @@ static int mov_read_packet(AVFormatContext *s, AVPacket 
*pkt)
 av_log(s, AV_LOG_TRACE, "stream %d, pts %"PRId64", dts %"PRId64", pos 
0x%"PRIx64", duration %"PRId64"\n",
 pkt->stream_index, pkt->pts, pkt->dts, pkt->pos, pkt->duration);
 
-/* Multiple stsd handling.
- * Keep track of the stsc index for the given sample, then check
- * if the stsd index is different from the last used one. */
-sc->stsc_sample++;
-if (sc->stsc_index < sc->stsc_count &&
-mov_get_stsc_samples(sc, sc->stsc_index) == sc->stsc_sample) {
-sc->stsc_index++;
-sc->stsc_sample = 0;
-/* Do not check indexes after a switch. */
-} else if (sc->stsc_data[sc->stsc_index].id - 1 != sc->last_stsd_index) {
-ret = mov_change_extradata(sc, pkt);
-if (ret < 0)
-return ret;
+/* Multiple stsd handling. */
+if (sc->stsc_data) {
+/* Keep track of the stsc index for the given sample, then check
+* if the stsd index is different from the last used one. */
+sc->stsc_sample++;
+if (sc->stsc_index < sc->stsc_count &&
+mov_get_stsc_samples(sc, sc->stsc_index) == sc->stsc_sample) {
+sc->stsc_index++;
+sc->stsc_sample = 0;
+/* Do not check indexes after a switch. */
+} else if (sc->stsc_data[sc->stsc_index].id - 1 != 
sc->last_stsd_index) {
+ret = mov_change_extradata(sc, pkt);
+if (ret < 0)
+return ret;
+}
 }
 
 return 0;
-- 
2.8.3

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] ffv1: Drop version 2

2016-06-16 Thread Vittorio Giovara
On Thu, Jun 16, 2016 at 10:04 AM, Luca Barbato  wrote:
> The version is deemed non-standardizable and the current draft considers
> it reserved.
>
> Do not produce files with that version.
> ---
>  libavcodec/ffv1enc.c | 79 
> 
>  1 file changed, 43 insertions(+), 36 deletions(-)

makes sense
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 2/5] pixdesc: Make sure color properties names match x264

2016-06-16 Thread Vittorio Giovara
On Thu, Jun 16, 2016 at 1:09 PM, Luca Barbato  wrote:
> On 16/06/16 18:56, Vittorio Giovara wrote:
>> The symbols with the unfortunate name were added in 4a66422 (17 Sep
>> 2015), they were not part of the 11 release, nor is the API in
>> question ever released in any libav release.
>
> Then we can change it as you like IMO.

Sure, I just hope the message conveyed is not "because I like it" but
rather "because it makes sense to do".
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] mov: Implement support for multiple sample description tables

2016-06-16 Thread Vittorio Giovara
On Wed, Jun 15, 2016 at 3:24 PM, Vittorio Giovara
 wrote:
> Store data from each stsd in a separate extradata buffer, keep track of
> the stsc index for read and seek operations, switch buffers when the
> index differs. Decoder is notified with an AV_PKT_DATA_NEW_EXTRADATA
> packet side data.
>
> Since H264 supports this notification, and can be reset midstream, enable
> this feature only for multiple avcC's. All other stsd types (such as
> hvc1 and hev1) need decoder-side changes, so they are left disabled for
> now.
>
> This is implemented only in non-fragmented MOVs.
>
> Signed-off-by: Vittorio Giovara 
> ---
> Squashed 5/5 in this one, moved extradata change to a separate function.
> Vittorio

Ok'd by Luca.
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 2/5] pixdesc: Make sure color properties names match x264

2016-06-16 Thread Vittorio Giovara
On Thu, Jun 16, 2016 at 4:31 AM, Diego Biurrun  wrote:
> On Wed, Jun 15, 2016 at 03:08:57PM -0400, Vittorio Giovara wrote:
>> On Wed, Jun 15, 2016 at 3:00 PM, Hendrik Leppkes  wrote:
>> > On Wed, Jun 15, 2016 at 8:53 PM, Luca Barbato  wrote:
>> >> On 15/06/16 20:25, Vittorio Giovara wrote:
>> >>> This allows to directly use av_color_*_name() return value as
>> >>> command line parameters for the encoder.
>> >>> ---
>> >>>  libavutil/pixdesc.c | 8 
>> >>>  libavutil/version.h | 2 +-
>> >>>  2 files changed, 5 insertions(+), 5 deletions(-)
>> >>
>> >> I consider the previous names bugs.
>> >
>> > Having the string names mismatch the symbol name seems like the real bug 
>> > to me.
>>
>> The alternative is to replace/deprecate symbol names, I'm not sure
>> whether a symbol name bikeshed warrants an API break (which would be
>> difficult to track since there cannot be guards for enum names).
>
> When were these symbols added?  Were they part of a release yet?
> If not...

The symbols with the unfortunate name were added in 4a66422 (17 Sep
2015), they were not part of the 11 release, nor is the API in
question ever released in any libav release.
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 2/5] pixdesc: Make sure color properties names match x264

2016-06-15 Thread Vittorio Giovara
On Wed, Jun 15, 2016 at 5:31 PM, Hendrik Leppkes  wrote:
> On Wed, Jun 15, 2016 at 11:06 PM, Vittorio Giovara
>  wrote:
>> On Wed, Jun 15, 2016 at 3:49 PM, Hendrik Leppkes  wrote:
>>> On Wed, Jun 15, 2016 at 9:08 PM, Vittorio Giovara
>>>  wrote:
>>>> On Wed, Jun 15, 2016 at 3:00 PM, Hendrik Leppkes  
>>>> wrote:
>>>>> On Wed, Jun 15, 2016 at 8:53 PM, Luca Barbato  wrote:
>>>>>> On 15/06/16 20:25, Vittorio Giovara wrote:
>>>>>>> This allows to directly use av_color_*_name() return value as
>>>>>>> command line parameters for the encoder.
>>>>>>> ---
>>>>>>>  libavutil/pixdesc.c | 8 
>>>>>>>  libavutil/version.h | 2 +-
>>>>>>>  2 files changed, 5 insertions(+), 5 deletions(-)
>>>>>>
>>>>>> I consider the previous names bugs.
>>>>>>
>>>>>
>>>>> Having the string names mismatch the symbol name seems like the real bug 
>>>>> to me.
>>>>
>>>> The alternative is to replace/deprecate symbol names, I'm not sure
>>>> whether a symbol name bikeshed warrants an API break (which would be
>>>> difficult to track since there cannot be guards for enum names).
>>>
>>> The alternative is to keep it as-is, imho.
>>
>> That defies the whole existence of this API and the rationale behind this 
>> set.
>
> Your whole set lacks reason, it looks like arbitrary renames to me
> because you like them better.

I guess you mean that you don't see the reason, not that it lacks it.

The API I wrote has been intended for that use since day one, to be
compatible with x264 settings: a very common usecase is to use
properties from probe json (which is filled by these functions) and
use them to call x264 from command line, without having to introduce a
conversion table from day one.

Unfortunately this got lost during the addition of new elements to the
enum, and with the adoption of different names from x264. Now that
they have been settled though, it seems wise to me to restore this
functionality. Also only very recent and very new elements are
affected, which are hardly available to distros probably.

Finally with the addition of 4/5 we will be able to use these names
when calling the conversion tool too, so we will finally be compatible
with ourselves.
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 2/5] pixdesc: Make sure color properties names match x264

2016-06-15 Thread Vittorio Giovara
On Wed, Jun 15, 2016 at 3:49 PM, Hendrik Leppkes  wrote:
> On Wed, Jun 15, 2016 at 9:08 PM, Vittorio Giovara
>  wrote:
>> On Wed, Jun 15, 2016 at 3:00 PM, Hendrik Leppkes  wrote:
>>> On Wed, Jun 15, 2016 at 8:53 PM, Luca Barbato  wrote:
>>>> On 15/06/16 20:25, Vittorio Giovara wrote:
>>>>> This allows to directly use av_color_*_name() return value as
>>>>> command line parameters for the encoder.
>>>>> ---
>>>>>  libavutil/pixdesc.c | 8 
>>>>>  libavutil/version.h | 2 +-
>>>>>  2 files changed, 5 insertions(+), 5 deletions(-)
>>>>
>>>> I consider the previous names bugs.
>>>>
>>>
>>> Having the string names mismatch the symbol name seems like the real bug to 
>>> me.
>>
>> The alternative is to replace/deprecate symbol names, I'm not sure
>> whether a symbol name bikeshed warrants an API break (which would be
>> difficult to track since there cannot be guards for enum names).
>
> The alternative is to keep it as-is, imho.

That defies the whole existence of this API and the rationale behind this set.
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH] mov: Implement support for multiple sample description tables

2016-06-15 Thread Vittorio Giovara
Store data from each stsd in a separate extradata buffer, keep track of
the stsc index for read and seek operations, switch buffers when the
index differs. Decoder is notified with an AV_PKT_DATA_NEW_EXTRADATA
packet side data.

Since H264 supports this notification, and can be reset midstream, enable
this feature only for multiple avcC's. All other stsd types (such as
hvc1 and hev1) need decoder-side changes, so they are left disabled for
now.

This is implemented only in non-fragmented MOVs.

Signed-off-by: Vittorio Giovara 
---
Squashed 5/5 in this one, moved extradata change to a separate function.
Vittorio

 libavformat/isom.h |   8 
 libavformat/mov.c  | 123 ++---
 2 files changed, 125 insertions(+), 6 deletions(-)

diff --git a/libavformat/isom.h b/libavformat/isom.h
index aec623b..75aa70b 100644
--- a/libavformat/isom.h
+++ b/libavformat/isom.h
@@ -105,6 +105,8 @@ typedef struct MOVStreamContext {
 MOVStts *ctts_data;
 unsigned int stsc_count;
 MOVStsc *stsc_data;
+int stsc_index;
+int stsc_sample;
 unsigned int stps_count;
 unsigned *stps_data;  ///< partial sync sample for mpeg-2 open gop
 int ctts_index;
@@ -137,6 +139,12 @@ typedef struct MOVStreamContext {
 unsigned int rap_group_count;
 MOVSbgp *rap_group;
 
+/** extradata array (and size) for multiple stsd */
+uint8_t **extradata;
+int *extradata_size;
+int last_stsd_index;
+int stsd_count;
+
 int32_t *display_matrix;
 } MOVStreamContext;
 
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 125919f..70c6b12 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1771,8 +1771,7 @@ static int mov_skip_multiple_stsd(MOVContext *c, 
AVIOContext *pb,
 int video_codec_id = ff_codec_get_id(ff_codec_movvideo_tags, format);
 
 if (codec_tag &&
-(codec_tag == AV_RL32("avc1") ||
- codec_tag == AV_RL32("hvc1") ||
+(codec_tag == AV_RL32("hvc1") ||
  codec_tag == AV_RL32("hev1") ||
  (codec_tag != format &&
   (c->fc->video_codec_id ? video_codec_id != c->fc->video_codec_id
@@ -1857,6 +1856,19 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext 
*pb, int entries)
 return ret;
 } else if (a.size > 0)
 avio_skip(pb, a.size);
+
+if (sc->extradata) {
+int extra_size = st->codecpar->extradata_size;
+
+/* Move the current stream extradata to the stream context one. */
+sc->extradata_size[pseudo_stream_id] = extra_size;
+sc->extradata[pseudo_stream_id] = av_malloc(extra_size + 
AV_INPUT_BUFFER_PADDING_SIZE);
+if (!sc->extradata[pseudo_stream_id])
+return AVERROR(ENOMEM);
+memcpy(sc->extradata[pseudo_stream_id], st->codecpar->extradata, 
extra_size);
+av_freep(&st->codecpar->extradata);
+st->codecpar->extradata_size = 0;
+}
 }
 
 if (pb->eof_reached)
@@ -1867,13 +1879,41 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext 
*pb, int entries)
 
 static int mov_read_stsd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
-int entries;
+AVStream *st;
+MOVStreamContext *sc;
+int ret;
+
+if (c->fc->nb_streams < 1)
+return 0;
+st = c->fc->streams[c->fc->nb_streams - 1];
+sc = st->priv_data;
 
 avio_r8(pb); /* version */
 avio_rb24(pb); /* flags */
-entries = avio_rb32(pb);
+sc->stsd_count = avio_rb32(pb); /* entries */
+
+/* Prepare space for hosting multiple extradata. */
+sc->extradata = av_mallocz_array(sc->stsd_count, sizeof(*sc->extradata));
+if (!sc->extradata)
+return AVERROR(ENOMEM);
 
-return ff_mov_read_stsd_entries(c, pb, entries);
+sc->extradata_size = av_mallocz_array(sc->stsd_count, 
sizeof(sc->extradata_size));
+if (!sc->extradata_size)
+return AVERROR(ENOMEM);
+
+ret = ff_mov_read_stsd_entries(c, pb, sc->stsd_count);
+if (ret < 0)
+return ret;
+
+/* Restore back the primary extradata. */
+av_free(st->codecpar->extradata);
+st->codecpar->extradata_size = sc->extradata_size[0];
+st->codecpar->extradata = av_mallocz(sc->extradata_size[0] + 
AV_INPUT_BUFFER_PADDING_SIZE);
+if (!st->codecpar->extradata)
+return AVERROR(ENOMEM);
+memcpy(st->codecpar->extradata, sc->extradata[0], sc->extradata_size[0]);
+
+return 0;
 }
 
 static int mov_read_stsc(MOVContext *c, AVIOContext *pb, MOVAtom atom)
@@ -1906,6 +1946,8 @@ static int mov_read_stsc(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 sc->stsc_data[i].first = avio_rb32(pb);
 sc->stsc_data[i].count = avio_rb32(pb);
 sc->stsc_data[i].id = avio_rb32(pb);
+

Re: [libav-devel] [PATCH 3/5] options_table: Drop the ST attribute from recent smpte color properties

2016-06-15 Thread Vittorio Giovara
On Wed, Jun 15, 2016 at 2:37 PM, Hendrik Leppkes  wrote:
> On Wed, Jun 15, 2016 at 8:25 PM, Vittorio Giovara
>  wrote:
>> It does not add anything distinctive or descriptive.
>> ---
>
> The name of the specification is SMPTE ST 428-1, I don't see what
> removing that "improves" here.

I think it's just less noise, eg it's evident that SMPTE 428-1 refers
to SMPTE ST 428-1, there is no other specification to be confused
with, and it makes it consistent with the other SMPTE-branded names.
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 2/5] pixdesc: Make sure color properties names match x264

2016-06-15 Thread Vittorio Giovara
On Wed, Jun 15, 2016 at 3:00 PM, Hendrik Leppkes  wrote:
> On Wed, Jun 15, 2016 at 8:53 PM, Luca Barbato  wrote:
>> On 15/06/16 20:25, Vittorio Giovara wrote:
>>> This allows to directly use av_color_*_name() return value as
>>> command line parameters for the encoder.
>>> ---
>>>  libavutil/pixdesc.c | 8 
>>>  libavutil/version.h | 2 +-
>>>  2 files changed, 5 insertions(+), 5 deletions(-)
>>
>> I consider the previous names bugs.
>>
>
> Having the string names mismatch the symbol name seems like the real bug to 
> me.

The alternative is to replace/deprecate symbol names, I'm not sure
whether a symbol name bikeshed warrants an API break (which would be
difficult to track since there cannot be guards for enum names).
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH 1/5] pixfmt: Add ARIB STD-B76 color transfer characteristic

2016-06-15 Thread Vittorio Giovara
From: Neil Birkbeck 

Adding hybrid log-gamma (https://en.wikipedia.org/wiki/Hybrid_Log-Gamma)
based on the standardization in ARIB STD-B67:
http://www.arib.or.jp/english/html/overview/doc/2-STD-B67v1_0.pdf

The choice of enum value of 18 is consistent with HEVC:
http://phenix.it-sudparis.eu/jct/doc_end_user/current_document.php?id=10481

And also with latest proposal for color format in mkv:
https://mailarchive.ietf.org/arch/search/?email_list=cellar&gbt=1&q=Colour+Format+proposal

Signed-off-by: Vittorio Giovara 
---
Adoped the same x264 name.
Needs lavc micro version bump.
Vittorio

 libavcodec/options_table.h | 1 +
 libavutil/pixdesc.c| 1 +
 libavutil/pixfmt.h | 1 +
 libavutil/version.h| 2 +-
 4 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index d2f6269..5c788ed 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -453,6 +453,7 @@ static const AVOption avcodec_options[] = {
 {"bt2020_12bit", "BT.2020 - 12 bit", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_BT2020_12 },INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"smptest2084",  "SMPTE ST 2084",0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_SMPTEST2084 },  INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"smptest428_1", "SMPTE ST 428-1",   0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_SMPTEST428_1 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"arib-std-b67", "ARIB STD-B67", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_ARIB_STD_B67 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"colorspace", "color space", OFFSET(colorspace), AV_OPT_TYPE_INT, {.i64 = 
AVCOL_SPC_UNSPECIFIED }, 0, AVCOL_SPC_NB-1, V|E|D, "colorspace_type"},
 {"rgb", "RGB", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_SPC_RGB },  
   INT_MIN, INT_MAX, V|E|D, "colorspace_type"},
 {"bt709",   "BT.709",  0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_SPC_BT709 
},   INT_MIN, INT_MAX, V|E|D, "colorspace_type"},
diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index 7a53ba3..209d107 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -1634,6 +1634,7 @@ static const char *color_transfer_names[] = {
 [AVCOL_TRC_BT2020_12] = "bt2020-20",
 [AVCOL_TRC_SMPTEST2084] = "smptest2084",
 [AVCOL_TRC_SMPTEST428_1] = "smptest428-1",
+[AVCOL_TRC_ARIB_STD_B67] = "arib-std-b67",
 };
 
 static const char *color_space_names[] = {
diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
index 5c7f468..621c9ac 100644
--- a/libavutil/pixfmt.h
+++ b/libavutil/pixfmt.h
@@ -324,6 +324,7 @@ enum AVColorTransferCharacteristic {
 AVCOL_TRC_BT2020_12= 15, ///< ITU-R BT2020 for 12-bit system
 AVCOL_TRC_SMPTEST2084  = 16, ///< SMPTE ST 2084 for 10-, 12-, 14- and 
16-bit systems
 AVCOL_TRC_SMPTEST428_1 = 17, ///< SMPTE ST 428-1
+AVCOL_TRC_ARIB_STD_B67 = 18, ///< ARIB STD-B67, known as "Hybrid log-gamma"
 AVCOL_TRC_NB,///< Not part of ABI
 };
 
diff --git a/libavutil/version.h b/libavutil/version.h
index 48a5878..7ea434e 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -54,7 +54,7 @@
  */
 
 #define LIBAVUTIL_VERSION_MAJOR 55
-#define LIBAVUTIL_VERSION_MINOR 13
+#define LIBAVUTIL_VERSION_MINOR 14
 #define LIBAVUTIL_VERSION_MICRO  0
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
-- 
2.8.3

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH 5/5] pixdesc: Add new SMPTE 431, 432, 2085 color properties

2016-06-15 Thread Vittorio Giovara
Appeared in H.264 2016/02.
---
Needs lavc micro version bump.
Vittorio

 libavcodec/options_table.h | 3 +++
 libavutil/pixdesc.c| 3 +++
 libavutil/pixfmt.h | 3 +++
 libavutil/version.h| 2 +-
 4 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index b849bb3..66420c7 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -436,6 +436,8 @@ static const AVOption avcodec_options[] = {
 {"film","Film",0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_FILM }, 
   INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"bt2020",  "BT.2020", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_BT2020 
},  INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"smpte428","SMPTE 428-1", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTEST428_1 }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
+{"smpte431","SMPTE 431-2", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTE431 },INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
+{"smpte432","SMPTE 422-1", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTE432 },INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"unspecified", "Unspecified", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_UNSPECIFIED }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"smptest428_1", "SMPTE 428-1", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTEST428_1 }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"color_trc", "color transfer characteristics", OFFSET(color_trc), 
AV_OPT_TYPE_INT, {.i64 = AVCOL_TRC_UNSPECIFIED }, 1, AVCOL_TRC_NB-1, V|E|D, 
"color_trc_type"},
@@ -476,6 +478,7 @@ static const AVOption avcodec_options[] = {
 {"ycocg",   "YCOCG",   0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_SPC_YCOCG 
},   INT_MIN, INT_MAX, V|E|D, "colorspace_type"},
 {"bt2020nc","BT.2020 NCL", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_SPC_BT2020_NCL },  INT_MIN, INT_MAX, V|E|D, "colorspace_type"},
 {"bt2020c", "BT.2020 CL",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_SPC_BT2020_CL },   INT_MIN, INT_MAX, V|E|D, "colorspace_type"},
+{"smpte2085",   "SMPTE 2085",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_SPC_SMPTE2085 },   INT_MIN, INT_MAX, V|E|D, "colorspace_type"},
 {"unspecified", "Unspecified", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_SPC_UNSPECIFIED }, INT_MIN, INT_MAX, V|E|D, "colorspace_type"},
 {"bt2020_ncl",  "BT.2020 NCL", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_SPC_BT2020_NCL },  INT_MIN, INT_MAX, V|E|D, "colorspace_type"},
 {"bt2020_cl",   "BT.2020 CL",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_SPC_BT2020_CL },   INT_MIN, INT_MAX, V|E|D, "colorspace_type"},
diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index 216452c..224d51a 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -1613,6 +1613,8 @@ static const char *color_primaries_names[] = {
 [AVCOL_PRI_FILM] = "film",
 [AVCOL_PRI_BT2020] = "bt2020",
 [AVCOL_PRI_SMPTEST428_1] = "smpte428",
+[AVCOL_PRI_SMPTE431] = "smpte431",
+[AVCOL_PRI_SMPTE432] = "smpte432",
 };
 
 static const char *color_transfer_names[] = {
@@ -1649,6 +1651,7 @@ static const char *color_space_names[] = {
 [AVCOL_SPC_YCOCG] = "ycgco",
 [AVCOL_SPC_BT2020_NCL] = "bt2020nc",
 [AVCOL_SPC_BT2020_CL] = "bt2020c",
+[AVCOL_SPC_SMPTE2085] = "smpte2085",
 };
 
 static const char *chroma_location_names[] = {
diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
index 621c9ac..58d87a0 100644
--- a/libavutil/pixfmt.h
+++ b/libavutil/pixfmt.h
@@ -299,6 +299,8 @@ enum AVColorPrimaries {
 AVCOL_PRI_FILM= 8, ///< colour filters using Illuminant C
 AVCOL_PRI_BT2020  = 9, ///< ITU-R BT2020
 AVCOL_PRI_SMPTEST428_1 = 10, ///< SMPTE ST 428-1 (CIE 1931 XYZ)
+AVCOL_PRI_SMPTE431= 11, ///< SMPTE ST 431-2 (2011)
+AVCOL_PRI_SMPTE432= 12, ///< SMPTE ST 432-1 D65 (2010)
 AVCOL_PRI_NB,  ///< Not part of ABI
 };
 
@@ -343,6 +345,7 @@ enum AVColorSpace {
 AVCOL_SPC_YCOCG   = 8,  ///< Used by Dirac / VC-2 and H.264 FRext, see 
ITU-T SG16
 AVCOL_SPC_BT2020_NCL  = 9,  ///< ITU-R BT2020 non-constant luminance system
 AVCOL_SPC_BT2020_CL   = 10, ///< ITU-R BT2020 constant luminance system
+AVCOL_SPC_SMPTE2085   = 11, ///< SMPTE 2085, Y'D'zD'x
 AVCOL_SPC_NB,   ///< Not part of ABI
 };
 
diff --git a/libavutil/version.h b/libavutil/version.h
index 09d3713..d13794c 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -54,7 +54,7 @@
  */
 
 #define LIBAVUTIL_VERSION_MAJOR 55
-#define LIBAVUTIL_VERSION_MINOR 15
+#define LIBAVUTIL_VERSION_MINOR 16
 #define LIBAVUTIL_VERSION_MICRO  0
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
-- 
2.8.3

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH 3/5] options_table: Drop the ST attribute from recent smpte color properties

2016-06-15 Thread Vittorio Giovara
It does not add anything distinctive or descriptive.
---
 libavcodec/options_table.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index 5c788ed..8c07022 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -435,7 +435,7 @@ static const AVOption avcodec_options[] = {
 {"smpte240m",   "SMPTE 240 M", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTE240M },   INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"film","Film",0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_FILM }, 
   INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"bt2020",  "BT.2020", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_BT2020 
},  INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
-{"smptest428_1", "SMPTE ST 428-1", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTEST428_1 }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
+{"smptest428_1", "SMPTE 428-1", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTEST428_1 }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"color_trc", "color transfer characteristics", OFFSET(color_trc), 
AV_OPT_TYPE_INT, {.i64 = AVCOL_TRC_UNSPECIFIED }, 1, AVCOL_TRC_NB-1, V|E|D, 
"color_trc_type"},
 {"bt709","BT.709",   0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_BT709 },INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"unspecified",  "Unspecified",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_UNSPECIFIED },  INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
@@ -451,8 +451,8 @@ static const AVOption avcodec_options[] = {
 {"iec61966_2_1", "IEC 61966-2-1",0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_IEC61966_2_1 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"bt2020_10bit", "BT.2020 - 10 bit", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_BT2020_10 },INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"bt2020_12bit", "BT.2020 - 12 bit", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_BT2020_12 },INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
-{"smptest2084",  "SMPTE ST 2084",0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_SMPTEST2084 },  INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
-{"smptest428_1", "SMPTE ST 428-1",   0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_SMPTEST428_1 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"smptest2084",  "SMPTE 2084",   0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_SMPTEST2084 },  INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"smptest428_1", "SMPTE 428-1",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_SMPTEST428_1 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"arib-std-b67", "ARIB STD-B67", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_ARIB_STD_B67 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"colorspace", "color space", OFFSET(colorspace), AV_OPT_TYPE_INT, {.i64 = 
AVCOL_SPC_UNSPECIFIED }, 0, AVCOL_SPC_NB-1, V|E|D, "colorspace_type"},
 {"rgb", "RGB", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_SPC_RGB },  
   INT_MIN, INT_MAX, V|E|D, "colorspace_type"},
-- 
2.8.3

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH 4/5] options_table: Add aliases for color properties

2016-06-15 Thread Vittorio Giovara
All option names now match the ones provided by the av_color_*_name().
---
Needs lavc micro version bump
 libavcodec/options_table.h | 27 ++-
 1 file changed, 22 insertions(+), 5 deletions(-)

diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index 8c07022..b849bb3 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -428,22 +428,35 @@ static const AVOption avcodec_options[] = {
 {"ticks_per_frame", NULL, OFFSET(ticks_per_frame), AV_OPT_TYPE_INT, {.i64 = 1 
}, 1, INT_MAX, A|V|E|D},
 {"color_primaries", "color primaries", OFFSET(color_primaries), 
AV_OPT_TYPE_INT, {.i64 = AVCOL_PRI_UNSPECIFIED }, 1, AVCOL_PRI_NB-1, V|E|D, 
"color_primaries_type"},
 {"bt709",   "BT.709",  0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_BT709 
},   INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
-{"unspecified", "Unspecified", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_UNSPECIFIED }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
+{"unknown", "Unspecified", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_UNSPECIFIED }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"bt470m",  "BT.470 M",0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_BT470M 
},  INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"bt470bg", "BT.470 BG",   0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_BT470BG 
}, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"smpte170m",   "SMPTE 170 M", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTE170M },   INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"smpte240m",   "SMPTE 240 M", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTE240M },   INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"film","Film",0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_FILM }, 
   INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"bt2020",  "BT.2020", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_BT2020 
},  INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
+{"smpte428","SMPTE 428-1", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTEST428_1 }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
+{"unspecified", "Unspecified", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_UNSPECIFIED }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"smptest428_1", "SMPTE 428-1", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTEST428_1 }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"color_trc", "color transfer characteristics", OFFSET(color_trc), 
AV_OPT_TYPE_INT, {.i64 = AVCOL_TRC_UNSPECIFIED }, 1, AVCOL_TRC_NB-1, V|E|D, 
"color_trc_type"},
 {"bt709","BT.709",   0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_BT709 },INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
-{"unspecified",  "Unspecified",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_UNSPECIFIED },  INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"unknown",  "Unspecified",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_UNSPECIFIED },  INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"gamma22",  "BT.470 M", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_GAMMA22 },  INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"gamma28",  "BT.470 BG",0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_GAMMA28 },  INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"smpte170m","SMPTE 170 M",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_SMPTE170M },INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"smpte240m","SMPTE 240 M",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_SMPTE240M },INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"linear",   "Linear",   0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_LINEAR },   INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"log100",   "Log",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_LOG },  INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"log316",   "Log square root",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_LOG_SQRT }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"iec61966-2-4", "IEC 61966-2-4",0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_IEC61966_2_4 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"bt1361e",  "BT.1361",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_BT1361_ECG },   INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"iec61966-2-1", "IEC 61966-2-1",0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_IEC61966_2_1 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"bt2020-10","BT.2020 - 10 bit", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_BT2020_10 },INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"bt2020-12","BT.2020 - 12 bit", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_BT2020_12 },INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"smpte2084","SMPTE 2084",   0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_SMPTEST2084 },  INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"smpte428", "SMPTE 428-1",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_SMPTEST428_1 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"arib_std_b67", "ARIB STD-B67", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_ARIB_STD_B67

[libav-devel] [PATCH 2/5] pixdesc: Make sure color properties names match x264

2016-06-15 Thread Vittorio Giovara
This allows to directly use av_color_*_name() return value as
command line parameters for the encoder.
---
 libavutil/pixdesc.c | 8 
 libavutil/version.h | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index 209d107..216452c 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -1612,7 +1612,7 @@ static const char *color_primaries_names[] = {
 [AVCOL_PRI_SMPTE240M] = "smpte240m",
 [AVCOL_PRI_FILM] = "film",
 [AVCOL_PRI_BT2020] = "bt2020",
-[AVCOL_PRI_SMPTEST428_1] = "smptest428-1",
+[AVCOL_PRI_SMPTEST428_1] = "smpte428",
 };
 
 static const char *color_transfer_names[] = {
@@ -1631,9 +1631,9 @@ static const char *color_transfer_names[] = {
 [AVCOL_TRC_BT1361_ECG] = "bt1361e",
 [AVCOL_TRC_IEC61966_2_1] = "iec61966-2-1",
 [AVCOL_TRC_BT2020_10] = "bt2020-10",
-[AVCOL_TRC_BT2020_12] = "bt2020-20",
-[AVCOL_TRC_SMPTEST2084] = "smptest2084",
-[AVCOL_TRC_SMPTEST428_1] = "smptest428-1",
+[AVCOL_TRC_BT2020_12] = "bt2020-12",
+[AVCOL_TRC_SMPTEST2084] = "smpte2084",
+[AVCOL_TRC_SMPTEST428_1] = "smpte428",
 [AVCOL_TRC_ARIB_STD_B67] = "arib-std-b67",
 };
 
diff --git a/libavutil/version.h b/libavutil/version.h
index 7ea434e..09d3713 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -54,7 +54,7 @@
  */
 
 #define LIBAVUTIL_VERSION_MAJOR 55
-#define LIBAVUTIL_VERSION_MINOR 14
+#define LIBAVUTIL_VERSION_MINOR 15
 #define LIBAVUTIL_VERSION_MICRO  0
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
-- 
2.8.3

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 102/115] dirac: Convert to the new bitstream reader

2016-06-13 Thread Vittorio Giovara
On Thu, Jun 9, 2016 at 11:13 AM, Diego Biurrun  wrote:
> From: Alexandra Hájková 
>
> ---
>  libavcodec/dirac.c | 89 
> +++---
>  1 file changed, 45 insertions(+), 44 deletions(-)

seems ok
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Re: [libav-devel] [PATCH 034/115] exr: Convert to the new bitstream reader

2016-06-13 Thread Vittorio Giovara
On Thu, Jun 9, 2016 at 11:12 AM, Diego Biurrun  wrote:
> From: Alexandra Hájková 
>
> ---
>  libavcodec/exr.c | 12 ++--
>  1 file changed, 6 insertions(+), 6 deletions(-)

ok
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Re: [libav-devel] [PATCH 041/115] hq_hqa: Convert to the new bitstream reader

2016-06-13 Thread Vittorio Giovara
On Thu, Jun 9, 2016 at 11:12 AM, Diego Biurrun  wrote:
> From: Alexandra Hájková 
>
> ---
>  libavcodec/hq_hqa.c | 48 
>  1 file changed, 24 insertions(+), 24 deletions(-)
>

i think it's ok
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Re: [libav-devel] [PATCH 042/115] hqx: Convert to the new bitstream header

2016-06-13 Thread Vittorio Giovara
On Thu, Jun 9, 2016 at 11:12 AM, Diego Biurrun  wrote:
> From: Alexandra Hájková 
>
> ---
>  libavcodec/hqx.c | 64 
> 
>  libavcodec/hqx.h |  5 +++--
>  2 files changed, 35 insertions(+), 34 deletions(-)
>

seems ok

-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Re: [libav-devel] [PATCH 071/115] mov: Convert to the new bitstream reader

2016-06-13 Thread Vittorio Giovara
On Thu, Jun 9, 2016 at 11:12 AM, Diego Biurrun  wrote:
> From: Alexandra Hájková 
>
> ---
>  libavformat/mov.c| 10 ++
>  libavformat/movenc.c | 41 +
>  2 files changed, 27 insertions(+), 24 deletions(-)
>
> @@ -461,28 +462,28 @@ static int mov_write_dvc1_structs(MOVTrack *track, 
> uint8_t *buf)
>  return AVERROR(ENOMEM);
>  start = find_next_marker(track->vos_data, end);
>  for (next = start; next < end; start = next) {
> -GetBitContext gb;
> +BitstreamContext bc;
>  int size;
>  next = find_next_marker(start + 4, end);
>  size = next - start - 4;
>  if (size <= 0)
>  continue;
>  unescaped_size = vc1_unescape_buffer(start + 4, size, unescaped);
> -init_get_bits(&gb, unescaped, 8 * unescaped_size);
> +bitstream_init(&bc, unescaped, 8 * unescaped_size);
>  if (AV_RB32(start) == VC1_CODE_SEQHDR) {
> -int profile = get_bits(&gb, 2);
> +int profile = bitstream_read(&bc, 2);
>  if (profile != PROFILE_ADVANCED) {
>  av_free(unescaped);
>  return AVERROR(ENOSYS);
>  }
>  seq_found = 1;
> -level = get_bits(&gb, 3);
> +level = bitstream_read(&bc, 3);
>  /* chromaformat, frmrtq_postproc, bitrtq_postproc, postprocflag,
>   * width, height */
> -skip_bits_long(&gb, 2 + 3 + 5 + 1 + 2*12);
> -skip_bits(&gb, 1); /* broadcast */
> -interlace = get_bits1(&gb);
> -skip_bits(&gb, 4); /* tfcntrflag, finterpflag, reserved, psf */
> +bitstream_skip(&bc, 2 + 3 + 5 + 1 + 2*12);

nit: 2 * 12?
ok regardless
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Re: [libav-devel] [PATCH 113/115] Remove legacy get_bits headers

2016-06-13 Thread Vittorio Giovara
On Thu, Jun 9, 2016 at 11:13 AM, Diego Biurrun  wrote:
> ---
>  libavcodec/get_bits.h  | 531 
>  libavcodec/golomb_legacy.h | 589 
> -
>  libavcodec/unary_legacy.h  |  56 -
>  3 files changed, 1176 deletions(-)
>  delete mode 100644 libavcodec/get_bits.h
>  delete mode 100644 libavcodec/golomb_legacy.h
>  delete mode 100644 libavcodec/unary_legacy.h

ok \o/
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] h264dsp: Change type of stride parameters to ptrdiff_t

2016-06-13 Thread Vittorio Giovara
On Mon, Jun 13, 2016 at 1:29 PM, Diego Biurrun  wrote:
> This avoids SIMD-optimized functions having to sign-extend their
> line size argument manually to be able to do pointer arithmetic.
> ---

ok if oracle is happy
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] avdevice: Ignore timefilter test program

2016-06-13 Thread Vittorio Giovara
On Mon, Jun 13, 2016 at 11:25 AM, Diego Biurrun  wrote:
> On Mon, Jun 13, 2016 at 10:50:40AM -0400, Vittorio Giovara wrote:
>> On Mon, Jun 13, 2016 at 8:54 AM, Diego Biurrun  wrote:
>> > --- /dev/null
>> > +++ b/libavdevice/tests/.gitignore
>> > @@ -0,0 +1 @@
>> > +/timefilter
>> > --
>>
>> sure but why?
>
> In order to ignore the generated file timefilter test program.  Why
> else?

right, i misinterpreted the patch
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] avdevice: Ignore timefilter test program

2016-06-13 Thread Vittorio Giovara
On Mon, Jun 13, 2016 at 8:54 AM, Diego Biurrun  wrote:
> ---
>  libavdevice/tests/.gitignore | 1 +
>  1 file changed, 1 insertion(+)
>  create mode 100644 libavdevice/tests/.gitignore
>
> diff --git a/libavdevice/tests/.gitignore b/libavdevice/tests/.gitignore
> new file mode 100644
> index 000..b4a2281
> --- /dev/null
> +++ b/libavdevice/tests/.gitignore
> @@ -0,0 +1 @@
> +/timefilter
> --

sure but why?

-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH] mov: Implement support for multiple sample description tables

2016-06-10 Thread Vittorio Giovara
Store data from each stsd in a separate extradata buffer, keep track of
the stsc index for read and seek operations, switch buffers when the
index differs. Decoder is notified with an AV_PKT_DATA_NEW_EXTRADATA
packet side data.

Since H264 supports this notification, and can be reset midstream, enable
this feature only for multiple avcC's. All other stsd types (such as
hvc1 and hev1) need decoder-side changes, so they are left disabled for
now.

This is implemented only in non-fragmented MOVs.

Signed-off-by: Vittorio Giovara 
---
In this iteration:
- dropped the stsd_count check everywhere
- addressed the case in which ff_mov_read_stsd_entries was called by rtpdec_qt
- added a note for non-fragmented movs
- minor documentation changes
Vittorio
 libavformat/isom.h |   8 
 libavformat/mov.c  | 112 ++---
 2 files changed, 114 insertions(+), 6 deletions(-)

diff --git a/libavformat/isom.h b/libavformat/isom.h
index aec623b..75aa70b 100644
--- a/libavformat/isom.h
+++ b/libavformat/isom.h
@@ -105,6 +105,8 @@ typedef struct MOVStreamContext {
 MOVStts *ctts_data;
 unsigned int stsc_count;
 MOVStsc *stsc_data;
+int stsc_index;
+int stsc_sample;
 unsigned int stps_count;
 unsigned *stps_data;  ///< partial sync sample for mpeg-2 open gop
 int ctts_index;
@@ -137,6 +139,12 @@ typedef struct MOVStreamContext {
 unsigned int rap_group_count;
 MOVSbgp *rap_group;
 
+/** extradata array (and size) for multiple stsd */
+uint8_t **extradata;
+int *extradata_size;
+int last_stsd_index;
+int stsd_count;
+
 int32_t *display_matrix;
 } MOVStreamContext;
 
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 125919f..30f49b6 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1771,8 +1771,7 @@ static int mov_skip_multiple_stsd(MOVContext *c, 
AVIOContext *pb,
 int video_codec_id = ff_codec_get_id(ff_codec_movvideo_tags, format);
 
 if (codec_tag &&
-(codec_tag == AV_RL32("avc1") ||
- codec_tag == AV_RL32("hvc1") ||
+(codec_tag == AV_RL32("hvc1") ||
  codec_tag == AV_RL32("hev1") ||
  (codec_tag != format &&
   (c->fc->video_codec_id ? video_codec_id != c->fc->video_codec_id
@@ -1857,6 +1856,19 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext 
*pb, int entries)
 return ret;
 } else if (a.size > 0)
 avio_skip(pb, a.size);
+
+if (sc->extradata) {
+int extra_size = st->codecpar->extradata_size;
+
+/* Move the current stream extradata to the stream context one. */
+sc->extradata_size[pseudo_stream_id] = extra_size;
+sc->extradata[pseudo_stream_id] = av_malloc(extra_size + 
AV_INPUT_BUFFER_PADDING_SIZE);
+if (!sc->extradata[pseudo_stream_id])
+return AVERROR(ENOMEM);
+memcpy(sc->extradata[pseudo_stream_id], st->codecpar->extradata, 
extra_size);
+av_freep(&st->codecpar->extradata);
+st->codecpar->extradata_size = 0;
+}
 }
 
 if (pb->eof_reached)
@@ -1867,13 +1879,41 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext 
*pb, int entries)
 
 static int mov_read_stsd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
-int entries;
+AVStream *st;
+MOVStreamContext *sc;
+int ret;
+
+if (c->fc->nb_streams < 1)
+return 0;
+st = c->fc->streams[c->fc->nb_streams - 1];
+sc = st->priv_data;
 
 avio_r8(pb); /* version */
 avio_rb24(pb); /* flags */
-entries = avio_rb32(pb);
+sc->stsd_count = avio_rb32(pb); /* entries */
+
+/* Prepare space for hosting multiple extradata. */
+sc->extradata = av_mallocz_array(sc->stsd_count, sizeof(*sc->extradata));
+if (!sc->extradata)
+return AVERROR(ENOMEM);
+
+sc->extradata_size = av_mallocz_array(sc->stsd_count, 
sizeof(sc->extradata_size));
+if (!sc->extradata_size)
+return AVERROR(ENOMEM);
 
-return ff_mov_read_stsd_entries(c, pb, entries);
+ret = ff_mov_read_stsd_entries(c, pb, sc->stsd_count);
+if (ret < 0)
+return ret;
+
+/* Restore back the primary extradata. */
+av_free(st->codecpar->extradata);
+st->codecpar->extradata_size = sc->extradata_size[0];
+st->codecpar->extradata = av_mallocz(sc->extradata_size[0] + 
AV_INPUT_BUFFER_PADDING_SIZE);
+if (!st->codecpar->extradata)
+return AVERROR(ENOMEM);
+memcpy(st->codecpar->extradata, sc->extradata[0], sc->extradata_size[0]);
+
+return 0;
 }
 
 static int mov_read_stsc(MOVContext *c, AVIOContext *pb, MOVAtom atom)
@@ -1916,6 +1956,19 @@ static int mov_read_stsc(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
   

Re: [libav-devel] [PATCH 3/3] mov: Implement support for multiple sample description tables

2016-06-10 Thread Vittorio Giovara
On Fri, Jun 10, 2016 at 2:32 PM, Martin Storsjö  wrote:
> On Thu, 9 Jun 2016, Martin Storsjö wrote:
>
>> On Mon, 6 Jun 2016, Vittorio Giovara wrote:
>>
>>> On Mon, Jun 6, 2016 at 2:57 PM, Martin Storsjö  wrote:
>>>>
>>>> On Wed, 1 Jun 2016, Vittorio Giovara wrote:
>>>>
>>>>> Store data from each stsd in a separate extradata buffer, keep track of
>>>>> the stsc index for read and seek operations, switch buffers when the
>>>>> index differs. Decoder is notified with an AV_PKT_DATA_NEW_EXTRADATA
>>>>> packet side data.
>>>>>
>>>>> Since H264 supports this notification, and can be reset midstream,
>>>>> enable
>>>>> this feature only for multiple avcC's. All other stsd types (such as
>>>>> hvc1 and hev1) need decoder-side changes, so they are left disabled for
>>>>> now.
>>>>>
>>>>> Signed-off-by: Vittorio Giovara 
>>>>> ---
>>>>> I slightly simplified the stsc/stsd index tracking so that it's less
>>>>> wasteful. I tried the seeking with mpv and lavf-seek test and it works
>>>>> as expected, so it's ready for inclusion from my point of view.
>>>>>
>>>>> Vittorio
>>>>>
>>>>>
>>>>> libavformat/isom.h |   8 
>>>>> libavformat/mov.c  | 120
>>>>> ++---
>>>>> 2 files changed, 122 insertions(+), 6 deletions(-)
>>>>
>>>>
>>>>
>>>> This sounds quite strange to me, but I might be missing something as
>>>> well.
>>>> Does this allow e.g. resolution changes in mp4/mov? Does it happen in
>>>> fragmented or in non-fragmented files, or in both? Can you provide a
>>
>> sample
>>>>
>>>> somewhere that I can have a look at? Does any standard specifically
>>>> allow
>>>> this?
>>>
>>>
>>> Hi, yes, this should be explicitly supported by the mp4 standard
>>> (14496-14) and it allows resolution changes in mp4/mov. I used
>>> boxdumper to inspect my sample and I could clearly see the multiple
>>> avcC entries with different parameters. This patch solves playback of
>>> http://upload.ffmpeg.org/ffmpeg/multiple_stsd.mp4. I would be happy to
>>> add it to fate if you think it makes sense.
>>
>>
>> Thanks - I hadn't realized that stsc can be used for this.
>
>
> FWIW, you didn't answer about fragmented vs non-fragmented above. This patch
> only adds support for it in non-fragmented files, while the same thing also
> can happen in fragmented files (although it requires all the sample
> descriptions upfront in moov), with sample description indices in trex and
> tfhd. No, I don't have samples, and that probably shouldn't block ths patch.
> Just wanted to let you know that there's a case you're not covering.

I see, I'll mention this in the commit log, thanks for the note.
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Re: [libav-devel] [PATCH 3/5] mov: Implement support for multiple sample description tables

2016-06-10 Thread Vittorio Giovara
On Fri, Jun 10, 2016 at 1:23 PM, Anton Khirnov  wrote:
> Quoting Vittorio Giovara (2016-06-10 16:52:39)
>> On Fri, Jun 10, 2016 at 4:56 AM, Anton Khirnov  wrote:
>> > Quoting Vittorio Giovara (2016-06-10 00:55:18)
>> >> Store data from each stsd in a separate extradata buffer, keep track of
>> >> the stsc index for read and seek operations, switch buffers when the
>> >> index differs. Decoder is notified with an AV_PKT_DATA_NEW_EXTRADATA
>> >> packet side data.
>> >>
>> >> Since H264 supports this notification, and can be reset midstream, enable
>> >> this feature only for multiple avcC's. All other stsd types (such as
>> >> hvc1 and hev1) need decoder-side changes, so they are left disabled for
>> >> now.
>> >>
>> >> Signed-off-by: Vittorio Giovara 
>> >> ---
>> >> Only modified to avoid caching a zero-sized extradata.
>> >> Vittorio
>> >>
>> >>  libavformat/isom.h |   8 
>> >>  libavformat/mov.c  | 123 
>> >> ++---
>> >>  2 files changed, 125 insertions(+), 6 deletions(-)
>> >>
>> >> diff --git a/libavformat/isom.h b/libavformat/isom.h
>> >> index aec623b..75aa70b 100644
>> >> --- a/libavformat/isom.h
>> >> +++ b/libavformat/isom.h
>> >> @@ -105,6 +105,8 @@ typedef struct MOVStreamContext {
>> >>  MOVStts *ctts_data;
>> >>  unsigned int stsc_count;
>> >>  MOVStsc *stsc_data;
>> >> +int stsc_index;
>> >> +int stsc_sample;
>> >>  unsigned int stps_count;
>> >>  unsigned *stps_data;  ///< partial sync sample for mpeg-2 open gop
>> >>  int ctts_index;
>> >> @@ -137,6 +139,12 @@ typedef struct MOVStreamContext {
>> >>  unsigned int rap_group_count;
>> >>  MOVSbgp *rap_group;
>> >>
>> >> +/** extradata array (and size) for multiple stsd */
>> >> +uint8_t **extradata;
>> >> +int *extradata_size;
>> >> +int last_stsd_index;
>> >> +int stsd_count;
>> >
>> > Nit: nb_stsd would be more consistent
>> >
>> >> +
>> >>  int32_t *display_matrix;
>> >>  } MOVStreamContext;
>> >>
>> >> diff --git a/libavformat/mov.c b/libavformat/mov.c
>> >> index 125919f..9e2d0e2 100644
>> >> --- a/libavformat/mov.c
>> >> +++ b/libavformat/mov.c
>> >> @@ -1771,8 +1771,7 @@ static int mov_skip_multiple_stsd(MOVContext *c, 
>> >> AVIOContext *pb,
>> >>  int video_codec_id = ff_codec_get_id(ff_codec_movvideo_tags, format);
>> >>
>> >>  if (codec_tag &&
>> >> -(codec_tag == AV_RL32("avc1") ||
>> >> - codec_tag == AV_RL32("hvc1") ||
>> >> +(codec_tag == AV_RL32("hvc1") ||
>> >>   codec_tag == AV_RL32("hev1") ||
>> >>   (codec_tag != format &&
>> >>(c->fc->video_codec_id ? video_codec_id != 
>> >> c->fc->video_codec_id
>> >> @@ -1857,6 +1856,20 @@ int ff_mov_read_stsd_entries(MOVContext *c, 
>> >> AVIOContext *pb, int entries)
>> >>  return ret;
>> >>  } else if (a.size > 0)
>> >>  avio_skip(pb, a.size);
>> >> +
>> >> +if (sc->stsd_count > 1) {
>> >
>> > Are all those checks really necessary? Naively I'd expect that
>> > stsd_count==1 is not really any different from stsd_count=n for any
>> > larger n.
>>
>> I just wanted to avoid needlessly allocating the extra layers and
>> copying data around.
>
> What data would be copied around? There might be some tiny additional
> overhead in read_header, but nothing otherwise.

There also is some overhead in packet_read and packet_seek, but if
dropping the condition does make the code a little simpler.
I'll resend with this change then.
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 4/5] mov: Support prores with multiple stsd

2016-06-10 Thread Vittorio Giovara
On Fri, Jun 10, 2016 at 4:56 AM, Anton Khirnov  wrote:
> Quoting Vittorio Giovara (2016-06-10 00:55:19)
>> This function needs to return false, or data in the additional tables
>> will be skipped, and the decoder will not be able to decode frames
>> associated with them.
>>
>> ---
>>  libavformat/mov.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/libavformat/mov.c b/libavformat/mov.c
>> index 9e2d0e2..9a7a0bc 100644
>> --- a/libavformat/mov.c
>> +++ b/libavformat/mov.c
>> @@ -1774,6 +1774,8 @@ static int mov_skip_multiple_stsd(MOVContext *c, 
>> AVIOContext *pb,
>>  (codec_tag == AV_RL32("hvc1") ||
>>   codec_tag == AV_RL32("hev1") ||
>>   (codec_tag != format &&
>> +  // prores is allowed to have differing data format and codec tag
>> +  codec_tag != AV_RL32("apcn") && codec_tag != AV_RL32("apch") &&
>>(c->fc->video_codec_id ? video_codec_id != c->fc->video_codec_id
>>   : codec_tag != MKTAG('j','p','e','g') {
>>  /* Multiple fourcc, we skip JPEG. This is not correct, we should
>> --
>> 2.8.3
>
> Sure would be nice to have a FATE test.

i can make one for the h264 one
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 3/5] mov: Implement support for multiple sample description tables

2016-06-10 Thread Vittorio Giovara
On Fri, Jun 10, 2016 at 4:56 AM, Anton Khirnov  wrote:
> Quoting Vittorio Giovara (2016-06-10 00:55:18)
>> Store data from each stsd in a separate extradata buffer, keep track of
>> the stsc index for read and seek operations, switch buffers when the
>> index differs. Decoder is notified with an AV_PKT_DATA_NEW_EXTRADATA
>> packet side data.
>>
>> Since H264 supports this notification, and can be reset midstream, enable
>> this feature only for multiple avcC's. All other stsd types (such as
>> hvc1 and hev1) need decoder-side changes, so they are left disabled for
>> now.
>>
>> Signed-off-by: Vittorio Giovara 
>> ---
>> Only modified to avoid caching a zero-sized extradata.
>> Vittorio
>>
>>  libavformat/isom.h |   8 
>>  libavformat/mov.c  | 123 
>> ++---
>>  2 files changed, 125 insertions(+), 6 deletions(-)
>>
>> diff --git a/libavformat/isom.h b/libavformat/isom.h
>> index aec623b..75aa70b 100644
>> --- a/libavformat/isom.h
>> +++ b/libavformat/isom.h
>> @@ -105,6 +105,8 @@ typedef struct MOVStreamContext {
>>  MOVStts *ctts_data;
>>  unsigned int stsc_count;
>>  MOVStsc *stsc_data;
>> +int stsc_index;
>> +int stsc_sample;
>>  unsigned int stps_count;
>>  unsigned *stps_data;  ///< partial sync sample for mpeg-2 open gop
>>  int ctts_index;
>> @@ -137,6 +139,12 @@ typedef struct MOVStreamContext {
>>  unsigned int rap_group_count;
>>  MOVSbgp *rap_group;
>>
>> +/** extradata array (and size) for multiple stsd */
>> +uint8_t **extradata;
>> +int *extradata_size;
>> +int last_stsd_index;
>> +int stsd_count;
>
> Nit: nb_stsd would be more consistent
>
>> +
>>  int32_t *display_matrix;
>>  } MOVStreamContext;
>>
>> diff --git a/libavformat/mov.c b/libavformat/mov.c
>> index 125919f..9e2d0e2 100644
>> --- a/libavformat/mov.c
>> +++ b/libavformat/mov.c
>> @@ -1771,8 +1771,7 @@ static int mov_skip_multiple_stsd(MOVContext *c, 
>> AVIOContext *pb,
>>  int video_codec_id = ff_codec_get_id(ff_codec_movvideo_tags, format);
>>
>>  if (codec_tag &&
>> -(codec_tag == AV_RL32("avc1") ||
>> - codec_tag == AV_RL32("hvc1") ||
>> +(codec_tag == AV_RL32("hvc1") ||
>>   codec_tag == AV_RL32("hev1") ||
>>   (codec_tag != format &&
>>(c->fc->video_codec_id ? video_codec_id != c->fc->video_codec_id
>> @@ -1857,6 +1856,20 @@ int ff_mov_read_stsd_entries(MOVContext *c, 
>> AVIOContext *pb, int entries)
>>  return ret;
>>  } else if (a.size > 0)
>>  avio_skip(pb, a.size);
>> +
>> +if (sc->stsd_count > 1) {
>
> Are all those checks really necessary? Naively I'd expect that
> stsd_count==1 is not really any different from stsd_count=n for any
> larger n.

I just wanted to avoid needlessly allocating the extra layers and
copying data around.

>> @@ -3376,6 +3434,13 @@ static int mov_read_close(AVFormatContext *s)
>>  av_freep(&sc->stps_data);
>>  av_freep(&sc->rap_group);
>>  av_freep(&sc->display_matrix);
>> +
>> +if (sc->stsd_count > 1)
>> +for (j = 0; j < sc->stsd_count; j++)
>> +if (sc->extradata_size[j] > 0)
>
> This looks rather fragile to me, why not just mallocz sc->extradata and
> then free its elements unconditionally.

ok i'll do that
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH 4/5] mov: Support prores with multiple stsd

2016-06-09 Thread Vittorio Giovara
This function needs to return false, or data in the additional tables
will be skipped, and the decoder will not be able to decode frames
associated with them.

---
 libavformat/mov.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 9e2d0e2..9a7a0bc 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1774,6 +1774,8 @@ static int mov_skip_multiple_stsd(MOVContext *c, 
AVIOContext *pb,
 (codec_tag == AV_RL32("hvc1") ||
  codec_tag == AV_RL32("hev1") ||
  (codec_tag != format &&
+  // prores is allowed to have differing data format and codec tag
+  codec_tag != AV_RL32("apcn") && codec_tag != AV_RL32("apch") &&
   (c->fc->video_codec_id ? video_codec_id != c->fc->video_codec_id
  : codec_tag != MKTAG('j','p','e','g') {
 /* Multiple fourcc, we skip JPEG. This is not correct, we should
-- 
2.8.3

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH 5/5] mov: Validate stsc indexes are within stsd bounds

2016-06-09 Thread Vittorio Giovara
---
Already approved.
Vittorio

 libavformat/mov.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 9a7a0bc..f09c614 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1954,6 +1954,8 @@ static int mov_read_stsc(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 sc->stsc_data[i].first = avio_rb32(pb);
 sc->stsc_data[i].count = avio_rb32(pb);
 sc->stsc_data[i].id = avio_rb32(pb);
+if (sc->stsc_data[i].id > sc->stsd_count)
+return AVERROR_INVALIDDATA;
 }
 
 sc->stsc_count = i;
-- 
2.8.3

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH 3/5] mov: Implement support for multiple sample description tables

2016-06-09 Thread Vittorio Giovara
Store data from each stsd in a separate extradata buffer, keep track of
the stsc index for read and seek operations, switch buffers when the
index differs. Decoder is notified with an AV_PKT_DATA_NEW_EXTRADATA
packet side data.

Since H264 supports this notification, and can be reset midstream, enable
this feature only for multiple avcC's. All other stsd types (such as
hvc1 and hev1) need decoder-side changes, so they are left disabled for
now.

Signed-off-by: Vittorio Giovara 
---
Only modified to avoid caching a zero-sized extradata.
Vittorio

 libavformat/isom.h |   8 
 libavformat/mov.c  | 123 ++---
 2 files changed, 125 insertions(+), 6 deletions(-)

diff --git a/libavformat/isom.h b/libavformat/isom.h
index aec623b..75aa70b 100644
--- a/libavformat/isom.h
+++ b/libavformat/isom.h
@@ -105,6 +105,8 @@ typedef struct MOVStreamContext {
 MOVStts *ctts_data;
 unsigned int stsc_count;
 MOVStsc *stsc_data;
+int stsc_index;
+int stsc_sample;
 unsigned int stps_count;
 unsigned *stps_data;  ///< partial sync sample for mpeg-2 open gop
 int ctts_index;
@@ -137,6 +139,12 @@ typedef struct MOVStreamContext {
 unsigned int rap_group_count;
 MOVSbgp *rap_group;
 
+/** extradata array (and size) for multiple stsd */
+uint8_t **extradata;
+int *extradata_size;
+int last_stsd_index;
+int stsd_count;
+
 int32_t *display_matrix;
 } MOVStreamContext;
 
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 125919f..9e2d0e2 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1771,8 +1771,7 @@ static int mov_skip_multiple_stsd(MOVContext *c, 
AVIOContext *pb,
 int video_codec_id = ff_codec_get_id(ff_codec_movvideo_tags, format);
 
 if (codec_tag &&
-(codec_tag == AV_RL32("avc1") ||
- codec_tag == AV_RL32("hvc1") ||
+(codec_tag == AV_RL32("hvc1") ||
  codec_tag == AV_RL32("hev1") ||
  (codec_tag != format &&
   (c->fc->video_codec_id ? video_codec_id != c->fc->video_codec_id
@@ -1857,6 +1856,20 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext 
*pb, int entries)
 return ret;
 } else if (a.size > 0)
 avio_skip(pb, a.size);
+
+if (sc->stsd_count > 1) {
+/* Move the current stream extradata to the stream context one.
+ * In this way, the stsd data can be stored away and a new stream
+ * extradata will be allocated by the read functions. */
+int size = st->codecpar->extradata_size;
+sc->extradata_size[pseudo_stream_id] = size;
+sc->extradata[pseudo_stream_id] = av_malloc(size + 
AV_INPUT_BUFFER_PADDING_SIZE);
+if (!sc->extradata[pseudo_stream_id])
+return AVERROR(ENOMEM);
+memcpy(sc->extradata[pseudo_stream_id], st->codecpar->extradata, 
size);
+av_freep(&st->codecpar->extradata);
+st->codecpar->extradata_size = 0;
+}
 }
 
 if (pb->eof_reached)
@@ -1867,13 +1880,46 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext 
*pb, int entries)
 
 static int mov_read_stsd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
-int entries;
+AVStream *st;
+MOVStreamContext *sc;
+int ret;
+
+if (c->fc->nb_streams < 1)
+return 0;
+st = c->fc->streams[c->fc->nb_streams - 1];
+sc = st->priv_data;
 
 avio_r8(pb); /* version */
 avio_rb24(pb); /* flags */
-entries = avio_rb32(pb);
+sc->stsd_count = avio_rb32(pb); /* entries */
+
+/* Prepare space for hosting multiple extradata. */
+if (sc->stsd_count > 1) {
+sc->extradata = av_malloc_array(sc->stsd_count, 
sizeof(*sc->extradata));
+if (!sc->extradata)
+return AVERROR(ENOMEM);
 
-return ff_mov_read_stsd_entries(c, pb, entries);
+sc->extradata_size = av_mallocz_array(sc->stsd_count, 
sizeof(sc->extradata_size));
+if (!sc->extradata_size)
+return AVERROR(ENOMEM);
+}
+
+ret = ff_mov_read_stsd_entries(c, pb, sc->stsd_count);
+if (ret < 0)
+return ret;
+
+/* Reset primary extradata. */
+if (sc->stsd_count > 1) {
+int size = sc->extradata_size[0];
+
+av_free(st->codecpar->extradata);
+st->codecpar->extradata_size = size;
+st->codecpar->extradata = av_mallocz(size + 
AV_INPUT_BUFFER_PADDING_SIZE);
+if (!st->codecpar->extradata)
+return AVERROR(ENOMEM);
+memcpy(st->codecpar->extradata, sc->extradata[0], size);
+}
+return 0;
 }
 
 static int mov_read_stsc(MOVContext *c, AVIOContext *pb, MOVAtom atom)
@@ -1916,6 +1962,19 @@ static int mov_read_stsc(MOVContext *c, AVIOContex

[libav-devel] [PATCH 2/5] h264: Support AV_PKT_DATA_NEW_EXTRADATA

2016-06-09 Thread Vittorio Giovara
---
Applied Anton's change.
Vittorio

 libavcodec/h264.c | 13 +
 1 file changed, 13 insertions(+)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 224ba2f..2dba261 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -1004,6 +1004,8 @@ static int h264_decode_frame(AVCodecContext *avctx, void 
*data,
 AVFrame *pict  = data;
 int buf_index  = 0;
 int ret;
+const uint8_t *new_extradata;
+int new_extradata_size;
 
 h->flags = avctx->flags;
 h->setup_finished = 0;
@@ -1042,6 +1044,17 @@ out:
 return buf_index;
 }
 
+new_extradata_size = 0;
+new_extradata = av_packet_get_side_data(avpkt, AV_PKT_DATA_NEW_EXTRADATA,
+&new_extradata_size);
+if (new_extradata_size > 0 && new_extradata) {
+ret = ff_h264_decode_extradata(new_extradata, new_extradata_size,
+   &h->ps, &h->is_avc, &h->nal_length_size,
+   avctx->err_recognition, avctx);
+if (ret < 0)
+return ret;
+}
+
 buf_index = decode_nal_units(h, buf, buf_size);
 if (buf_index < 0)
 return AVERROR_INVALIDDATA;
-- 
2.8.3

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH 1/5] lavc: Document AV_PKT_DATA_NEW_EXTRADATA

2016-06-09 Thread Vittorio Giovara
---
Already approved.
 libavcodec/avcodec.h | 8 
 1 file changed, 8 insertions(+)

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index f33b7e5..01a6286 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1187,6 +1187,14 @@ typedef struct AVCPBProperties {
  */
 enum AVPacketSideDataType {
 AV_PKT_DATA_PALETTE,
+
+/**
+ * The AV_PKT_DATA_NEW_EXTRADATA is used to notify the codec or the format
+ * that the extradata buffer was changed and the receiving side should
+ * act upon it appropriately. The new extradata is embedded in the side
+ * data buffer and should be immediately used for processing the current
+ * frame or packet.
+ */
 AV_PKT_DATA_NEW_EXTRADATA,
 
 /**
-- 
2.8.3

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH] avpacket: Error out when creating 0-sized side data

2016-06-09 Thread Vittorio Giovara
This mimics the behaviour of other av_*_new_side_data().
This is not caught by the malloc check, since AV_INPUT_BUFFER_PADDING_SIZE
is always added to the allocated size.

Signed-off-by: Vittorio Giovara 
---
This is assuming that packet side data cannot be used empty.
[documentation needed]
Vittorio

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

diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index 04d6244..76fc4eb 100644
--- a/libavcodec/avpacket.c
+++ b/libavcodec/avpacket.c
@@ -265,7 +265,7 @@ uint8_t *av_packet_new_side_data(AVPacket *pkt, enum 
AVPacketSideDataType type,
 int ret;
 uint8_t *data;
 
-if ((unsigned)size > INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE)
+if (!size || (unsigned)size > INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE)
 return NULL;
 data = av_malloc(size + AV_INPUT_BUFFER_PADDING_SIZE);
 if (!data)
-- 
2.8.3

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] avpacket: Error out when creating 0-sized side data

2016-06-09 Thread Vittorio Giovara
On Thu, Jun 9, 2016 at 6:31 PM, Vittorio Giovara
 wrote:
> This mimics the behaviour of other av_*_new_side_data().
> This is not caught by the malloc check, since AV_INPUT_BUFFER_PADDING_SIZE
> is always added to the allocated size.
>
> Signed-off-by: Vittorio Giovara 
> ---
> This is assuming that packet side data cannot be used empty.
> [documentation needed]
> Vittorio

sorry wrong patch sent

-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH] avpacket: Error out when creating 0-sized side data

2016-06-09 Thread Vittorio Giovara
This mimics the behaviour of other av_*_new_side_data().
This is not caught by the malloc check, since AV_INPUT_BUFFER_PADDING_SIZE
is always added to the allocated size.

Signed-off-by: Vittorio Giovara 
---
This is assuming that packet side data cannot be used empty.
[documentation needed]
Vittorio

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

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 385bd1d..92b3c7e 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1780,7 +1780,8 @@ static int mov_skip_multiple_stsd(MOVContext *c, 
AVIOContext *pb,
  * export it as a separate AVStream but this needs a few changes
  * in the MOV demuxer, patch welcome. */
 
-av_log(c->fc, AV_LOG_WARNING, "multiple fourcc not supported\n");
+av_log(c->fc, AV_LOG_WARNING, "multiple fourcc not supported %d %d\n",
+   codec_tag, format);
 avio_skip(pb, size);
 return 1;
 }
-- 
2.8.3

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 10/28] h264: factor out setting frame properties / side data

2016-06-09 Thread Vittorio Giovara
On Thu, Jun 9, 2016 at 4:29 AM, Anton Khirnov  wrote:
> Right now this code is mixed with selecting the next output frame. Move
> it to a separate function called from h264_field_start(), which is a
> more appropriate place for this.
> ---

ok
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 2/3] h264: Support AV_PKT_DATA_NEW_EXTRADATA

2016-06-09 Thread Vittorio Giovara
On Thu, Jun 9, 2016 at 4:46 PM, Anton Khirnov  wrote:
> Quoting Vittorio Giovara (2016-06-09 22:42:30)
>> On Thu, Jun 9, 2016 at 4:36 PM, Anton Khirnov  wrote:
>> > Quoting Vittorio Giovara (2016-06-02 02:00:03)
>> >> ---
>> >> I left the context extradata unchanged, and I process the new extradata
>> >> directly. This fixed the crash at decoder_close.
>> >> Vittorio
>> >>
>> >>  libavcodec/h264.c | 15 +++
>> >>  1 file changed, 15 insertions(+)
>> >>
>> >> diff --git a/libavcodec/h264.c b/libavcodec/h264.c
>> >> index 224ba2f..869b528 100644
>> >> --- a/libavcodec/h264.c
>> >> +++ b/libavcodec/h264.c
>> >> @@ -1042,6 +1042,21 @@ out:
>> >>  return buf_index;
>> >>  }
>> >>
>> >> +if (h->is_avc) {
>> >
>> > Why this condition?
>>
>> because the extradata change from the container can only happen with
>> avc1 files, extradata change from the embedded stream (annexb) is
>> already supported as far as i understand
>
> I assume you're talking about in-stream parameter sets. Those are
> supported, but nothing prevents you from having out of band parameter
> set updates with annex b as well.

Yes i was referring to in-stream parameter sets.
Ok I'll drop the condition then
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 2/3] h264: Support AV_PKT_DATA_NEW_EXTRADATA

2016-06-09 Thread Vittorio Giovara
On Thu, Jun 9, 2016 at 4:36 PM, Anton Khirnov  wrote:
> Quoting Vittorio Giovara (2016-06-02 02:00:03)
>> ---
>> I left the context extradata unchanged, and I process the new extradata
>> directly. This fixed the crash at decoder_close.
>> Vittorio
>>
>>  libavcodec/h264.c | 15 +++
>>  1 file changed, 15 insertions(+)
>>
>> diff --git a/libavcodec/h264.c b/libavcodec/h264.c
>> index 224ba2f..869b528 100644
>> --- a/libavcodec/h264.c
>> +++ b/libavcodec/h264.c
>> @@ -1042,6 +1042,21 @@ out:
>>  return buf_index;
>>  }
>>
>> +if (h->is_avc) {
>
> Why this condition?

because the extradata change from the container can only happen with
avc1 files, extradata change from the embedded stream (annexb) is
already supported as far as i understand
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 077/115] dv: Convert to the new bitreader

2016-06-09 Thread Vittorio Giovara
On Thu, Jun 9, 2016 at 11:12 AM, Diego Biurrun  wrote:
> From: Luca Barbato 
>
> ---
>  libavcodec/dvdec.c | 122 
> ++---
>  1 file changed, 69 insertions(+), 53 deletions(-)
>
> diff --git a/libavcodec/dvdec.c b/libavcodec/dvdec.c
> index 463d108..3ccd672 100644
> --- a/libavcodec/dvdec.c
> +++ b/libavcodec/dvdec.c
> @@ -40,9 +40,9 @@
>  #include "libavutil/pixdesc.h"
>
>  #include "avcodec.h"
> +#include "bitstream.h"
>  #include "dv.h"
>  #include "dvdata.h"
> -#include "get_bits.h"
>  #include "idctdsp.h"
>  #include "internal.h"
>  #include "put_bits.h"
> @@ -79,52 +79,63 @@ static av_cold int dvvideo_decode_init(AVCodecContext 
> *avctx)
>  return ff_dvvideo_init(avctx);
>  }
>
> +// unwind the cache so a fill32 can fill it back
> +static void bitstream_unwind(BitstreamContext *bc)
> +{
> +int unwind = 4;
> +int unwind_bits = unwind * 8;
> +
> +if (bc->bits_left < unwind_bits)
> +return;
> +
> +bc->bits >>= unwind_bits;
> +bc->bits <<= unwind_bits;
> +bc->bits_left -= unwind_bits;
> +bc->ptr -= unwind;
> +}
> +
> +// unget up to 32 bits
> +static void bitstream_unget(BitstreamContext *bc, uint64_t value, int size)
> +{
> +int cache_size = sizeof(bc->bits) * 8;
> +
> +if (bc->bits_left + size > cache_size)
> +bitstream_unwind(bc);
> +
> +bc->bits = (bc->bits >> size) | (value << (cache_size - size));
> +
> +bc->bits_left += size;
> +}

maybe these two functions could be dv_ prefixed to avoid clashing with
the main bitstream API?
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 02/28] h264: move the block starting a new field out of slice_header_parse()

2016-06-09 Thread Vittorio Giovara
On Thu, Jun 9, 2016 at 4:29 AM, Anton Khirnov  wrote:
> There is no bitstream parsing in that block and messing with
> decoder-global state is not something that belongs into header parsing.
>
> Nothing else in this function depends on the value of current_slice,
> except for two validity checks. Those checks are also moved out of
> slice_header_parse().
> ---
>  libavcodec/h264_slice.c | 68 
> -
>  1 file changed, 33 insertions(+), 35 deletions(-)
>
> diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
> index 17608b4..c43a0be 100644
> --- a/libavcodec/h264_slice.c
> +++ b/libavcodec/h264_slice.c
> @@ -1177,21 +1177,6 @@ static int h264_slice_header_parse(H264Context *h, 
> H264SliceContext *sl,
>
>  sl->first_mb_addr = get_ue_golomb(&sl->gb);
>
> -if (sl->first_mb_addr == 0) { // FIXME better field boundary detection
> -if (h->current_slice && h->cur_pic_ptr && FIELD_PICTURE(h)) {
> -ff_h264_field_end(h, sl, 1);
> -}
> -
> -h->current_slice = 0;
> -if (!h->first_field) {
> -if (h->cur_pic_ptr && !h->droppable) {
> -ff_thread_report_progress(&h->cur_pic_ptr->tf, INT_MAX,
> -  h->picture_structure == 
> PICT_BOTTOM_FIELD);
> -}
> -h->cur_pic_ptr = NULL;
> -}
> -}
> -
>  slice_type = get_ue_golomb_31(&sl->gb);
>  if (slice_type > 9) {
>  av_log(h->avctx, AV_LOG_ERROR,
> @@ -1226,11 +1211,6 @@ static int h264_slice_header_parse(H264Context *h, 
> H264SliceContext *sl,
> sl->pps_id);
>  return AVERROR_INVALIDDATA;
>  }
> -if (h->current_slice > 0 &&
> -h->ps.pps != (const PPS*)h->ps.pps_list[sl->pps_id]->data) {
> -av_log(h->avctx, AV_LOG_ERROR, "PPS changed between slices\n");
> -return AVERROR_INVALIDDATA;
> -}
>  pps = (const PPS*)h->ps.pps_list[sl->pps_id]->data;
>
>  if (!h->ps.sps_list[pps->sps_id]) {
> @@ -1265,21 +1245,6 @@ static int h264_slice_header_parse(H264Context *h, 
> H264SliceContext *sl,
>  sl->picture_structure  = picture_structure;
>  sl->mb_field_decoding_flag = picture_structure != PICT_FRAME;
>
> -if (h->current_slice != 0) {
> -if (h->picture_structure != picture_structure ||
> -h->droppable != droppable) {
> -av_log(h->avctx, AV_LOG_ERROR,
> -   "Changing field mode (%d -> %d) between slices is not 
> allowed\n",
> -   h->picture_structure, picture_structure);
> -return AVERROR_INVALIDDATA;
> -} else if (!h->cur_pic_ptr) {
> -av_log(h->avctx, AV_LOG_ERROR,
> -   "unset cur_pic_ptr on slice %d\n",
> -   h->current_slice + 1);
> -return AVERROR_INVALIDDATA;
> -}
> -}
> -
>  if (picture_structure == PICT_FRAME) {
>  h->curr_pic_num = h->poc.frame_num;
>  h->max_pic_num  = 1 << sps->log2_max_frame_num;
> @@ -1430,10 +1395,43 @@ int ff_h264_decode_slice_header(H264Context *h, 
> H264SliceContext *sl,
>  if (ret < 0)
>  return ret;
>
> +if (sl->first_mb_addr == 0) { // FIXME better field boundary detection

does this FIXME still apply?

> +if (h->current_slice && h->cur_pic_ptr && FIELD_PICTURE(h)) {
> +ff_h264_field_end(h, sl, 1);
> +}
> +
> +h->current_slice = 0;
> +if (!h->first_field) {
> +if (h->cur_pic_ptr && !h->droppable) {
> +ff_thread_report_progress(&h->cur_pic_ptr->tf, INT_MAX,
> +  h->picture_structure == 
> PICT_BOTTOM_FIELD);
> +}
> +h->cur_pic_ptr = NULL;
> +}
> +}
> +
>  if (h->current_slice == 0) {
>  ret = h264_field_start(h, sl, nal);
>  if (ret < 0)
>  return ret;
> +} else {
> +if (h->ps.pps != (const PPS*)h->ps.pps_list[sl->pps_id]->data) {
> +av_log(h->avctx, AV_LOG_ERROR, "PPS changed between slices\n");
> +return AVERROR_INVALIDDATA;
> +}
> +
> +if (h->picture_structure != sl->picture_structure ||
> +h->droppable != (nal->ref_idc == 0)) {
> +av_log(h->avctx, AV_LOG_ERROR,
> +   "Changing field mode (%d -> %d) between slices is not 
> allowed\n",
> +   h->picture_structure, sl->picture_structure);
> +return AVERROR_INVALIDDATA;
> +} else if (!h->cur_pic_ptr) {
> +av_log(h->avctx, AV_LOG_ERROR,
> +   "unset cur_pic_ptr on slice %d\n",
> +   h->current_slice + 1);
> +return AVERROR_INVALIDDATA;
> +}
>  }
>
>  assert(h->mb_num == h->mb_width * h->mb_height);
> --

probably ok
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
http

Re: [libav-devel] [PATCH 01/28] h264: pass a H2645NAL to slice header decoding

2016-06-09 Thread Vittorio Giovara
On Thu, Jun 9, 2016 at 4:29 AM, Anton Khirnov  wrote:
> Replace the decoder-global nal_unit_type/nal_ref_idc variables with the
> per-NAL ones. The decoder-global ones still cannot be removed because
> they are used by hwaccels.
> ---
>  libavcodec/h264.c   |  2 +-
>  libavcodec/h264.h   |  3 ++-
>  libavcodec/h264_slice.c | 29 -
>  3 files changed, 19 insertions(+), 15 deletions(-)

seems ok
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 15/28] h264: tighten the valid range for ref_frame_count

2016-06-09 Thread Vittorio Giovara
On Thu, Jun 9, 2016 at 4:54 AM, Diego Biurrun  wrote:
> On Thu, Jun 09, 2016 at 10:30:01AM +0200, Anton Khirnov wrote:
>> This field (which the spec calls max_num_ref_frames) must be less or
>> equal to MaxDpbFrames, which is at most 16.
>
> less than
>
> Diego

lgtm with that fixed
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 13/28] svq3: stop using H264Picture

2016-06-09 Thread Vittorio Giovara
On Thu, Jun 9, 2016 at 4:29 AM, Anton Khirnov  wrote:
> The SVQ3 decoder has been decoupled from the H.264 decoder, so it can
> now use its own data type.
> ---
>  libavcodec/svq3.c | 34 --
>  1 file changed, 24 insertions(+), 10 deletions(-)

Nice
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 3/3] mov: Implement support for multiple sample description tables

2016-06-06 Thread Vittorio Giovara
On Mon, Jun 6, 2016 at 2:57 PM, Martin Storsjö  wrote:
> On Wed, 1 Jun 2016, Vittorio Giovara wrote:
>
>> Store data from each stsd in a separate extradata buffer, keep track of
>> the stsc index for read and seek operations, switch buffers when the
>> index differs. Decoder is notified with an AV_PKT_DATA_NEW_EXTRADATA
>> packet side data.
>>
>> Since H264 supports this notification, and can be reset midstream, enable
>> this feature only for multiple avcC's. All other stsd types (such as
>> hvc1 and hev1) need decoder-side changes, so they are left disabled for
>> now.
>>
>> Signed-off-by: Vittorio Giovara 
>> ---
>> I slightly simplified the stsc/stsd index tracking so that it's less
>> wasteful. I tried the seeking with mpv and lavf-seek test and it works
>> as expected, so it's ready for inclusion from my point of view.
>>
>> Vittorio
>>
>>
>> libavformat/isom.h |   8 
>> libavformat/mov.c  | 120
>> ++---
>> 2 files changed, 122 insertions(+), 6 deletions(-)
>
>
> This sounds quite strange to me, but I might be missing something as well.
> Does this allow e.g. resolution changes in mp4/mov? Does it happen in
> fragmented or in non-fragmented files, or in both? Can you provide a sample
> somewhere that I can have a look at? Does any standard specifically allow
> this?

Hi, yes, this should be explicitly supported by the mp4 standard
(14496-14) and it allows resolution changes in mp4/mov. I used
boxdumper to inspect my sample and I could clearly see the multiple
avcC entries with different parameters. This patch solves playback of
http://upload.ffmpeg.org/ffmpeg/multiple_stsd.mp4. I would be happy to
add it to fate if you think it makes sense.

In the previous iteration of this patch I was replacing the codecpar
structure completely, but I was pointed at the fact that a stream is
not allowed to change it after the codec is open. So I modified the
decoder extradata instead which (with the proper side data) can reset
the decoder level and/or change frame properties (triggering messages
like "Input stream #0:1 frame changed from size:1280x720 fmt:yuv420p
to size:480x640 fmt:yuv420p").

The only "glitch" that either version of the patchset seem to
introduce is in {ff,av}play. If you scrub (click and drag) across the
boundaries where the index change happens, the seek function is
somehow cancelled and the sample table is not updated, leading the
decoder to use the old extradata which prevents frames to be decoded
correctly. Seeking by clicking or by -ss work as intended, and the
libavformat/test/seek test program produces the correct results too.
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Re: [libav-devel] [PATCH] mov: Validate stsc indexes are within stsd bounds

2016-06-06 Thread Vittorio Giovara
On Mon, Jun 6, 2016 at 1:26 PM, Luca Barbato  wrote:
> On 06/06/16 18:47, Vittorio Giovara wrote:
>> ---
>>  libavformat/mov.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/libavformat/mov.c b/libavformat/mov.c
>> index fceef5b..385bd1d 100644
>> --- a/libavformat/mov.c
>> +++ b/libavformat/mov.c
>> @@ -1952,6 +1952,8 @@ static int mov_read_stsc(MOVContext *c, AVIOContext 
>> *pb, MOVAtom atom)
>>  sc->stsc_data[i].first = avio_rb32(pb);
>>  sc->stsc_data[i].count = avio_rb32(pb);
>>  sc->stsc_data[i].id = avio_rb32(pb);
>> +if (sc->stsc_data[i].id > sc->stsd_count)
>> +return AVERROR_INVALIDDATA;
>>  }
>>
>>  sc->stsc_count = i;
>>
>
> Ok
>
> That's a stable candidate =)

we don't use the index for anything in stable, so it's probably ok to
skip this patch there
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH] mov: Validate stsc indexes are within stsd bounds

2016-06-06 Thread Vittorio Giovara
---
 libavformat/mov.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index fceef5b..385bd1d 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1952,6 +1952,8 @@ static int mov_read_stsc(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 sc->stsc_data[i].first = avio_rb32(pb);
 sc->stsc_data[i].count = avio_rb32(pb);
 sc->stsc_data[i].id = avio_rb32(pb);
+if (sc->stsc_data[i].id > sc->stsd_count)
+return AVERROR_INVALIDDATA;
 }
 
 sc->stsc_count = i;
-- 
2.8.3

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 3/3] mov: Implement support for multiple sample description tables

2016-06-06 Thread Vittorio Giovara
On Fri, Jun 3, 2016 at 5:24 AM, Luca Barbato  wrote:
> On 02/06/16 02:00, Vittorio Giovara wrote:
>> Store data from each stsd in a separate extradata buffer, keep track of
>> the stsc index for read and seek operations, switch buffers when the
>> index differs. Decoder is notified with an AV_PKT_DATA_NEW_EXTRADATA
>> packet side data.
>>
>> Since H264 supports this notification, and can be reset midstream, enable
>> this feature only for multiple avcC's. All other stsd types (such as
>> hvc1 and hev1) need decoder-side changes, so they are left disabled for
>> now.
>>
>> Signed-off-by: Vittorio Giovara 
>> ---
>> I slightly simplified the stsc/stsd index tracking so that it's less
>> wasteful. I tried the seeking with mpv and lavf-seek test and it works
>> as expected, so it's ready for inclusion from my point of view.
>>
>> Vittorio
>>
>>
>>  libavformat/isom.h |   8 
>>  libavformat/mov.c  | 120 
>> ++---
>>  2 files changed, 122 insertions(+), 6 deletions(-)
>>
>> diff --git a/libavformat/isom.h b/libavformat/isom.h
>> index aec623b..75aa70b 100644
>> --- a/libavformat/isom.h
>> +++ b/libavformat/isom.h
>> @@ -105,6 +105,8 @@ typedef struct MOVStreamContext {
>>  MOVStts *ctts_data;
>>  unsigned int stsc_count;
>>  MOVStsc *stsc_data;
>> +int stsc_index;
>> +int stsc_sample;
>>  unsigned int stps_count;
>>  unsigned *stps_data;  ///< partial sync sample for mpeg-2 open gop
>>  int ctts_index;
>> @@ -137,6 +139,12 @@ typedef struct MOVStreamContext {
>>  unsigned int rap_group_count;
>>  MOVSbgp *rap_group;
>>
>> +/** extradata array (and size) for multiple stsd */
>> +uint8_t **extradata;
>> +int *extradata_size;
>> +int last_stsd_index;
>> +int stsd_count;
>> +
>>  int32_t *display_matrix;
>>  } MOVStreamContext;
>>
>> diff --git a/libavformat/mov.c b/libavformat/mov.c
>> index 125919f..fceef5b 100644
>> --- a/libavformat/mov.c
>> +++ b/libavformat/mov.c
>> @@ -1771,8 +1771,7 @@ static int mov_skip_multiple_stsd(MOVContext *c, 
>> AVIOContext *pb,
>>  int video_codec_id = ff_codec_get_id(ff_codec_movvideo_tags, format);
>>
>>  if (codec_tag &&
>> -(codec_tag == AV_RL32("avc1") ||
>> - codec_tag == AV_RL32("hvc1") ||
>> +(codec_tag == AV_RL32("hvc1") ||
>>   codec_tag == AV_RL32("hev1") ||
>>   (codec_tag != format &&
>>(c->fc->video_codec_id ? video_codec_id != c->fc->video_codec_id
>> @@ -1857,6 +1856,20 @@ int ff_mov_read_stsd_entries(MOVContext *c, 
>> AVIOContext *pb, int entries)
>>  return ret;
>>  } else if (a.size > 0)
>>  avio_skip(pb, a.size);
>> +
>> +if (sc->stsd_count > 1) {
>> +/* Move the current stream extradata to the stream context one.
>> + * In this way, the stsd data can be stored away and a new 
>> stream
>> + * extradata will be allocated by the read functions. */
>> +int size = st->codecpar->extradata_size;
>> +sc->extradata_size[pseudo_stream_id] = size;
>> +sc->extradata[pseudo_stream_id] = av_malloc(size + 
>> AV_INPUT_BUFFER_PADDING_SIZE);
>> +if (!sc->extradata[pseudo_stream_id])
>> +return AVERROR(ENOMEM);
>> +memcpy(sc->extradata[pseudo_stream_id], 
>> st->codecpar->extradata, size);
>> +av_freep(&st->codecpar->extradata);
>> +st->codecpar->extradata_size = 0;
>> +}
>>  }
>>
>>  if (pb->eof_reached)
>> @@ -1867,13 +1880,46 @@ int ff_mov_read_stsd_entries(MOVContext *c, 
>> AVIOContext *pb, int entries)
>>
>>  static int mov_read_stsd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
>>  {
>> -int entries;
>> +AVStream *st;
>> +MOVStreamContext *sc;
>> +int ret;
>> +
>> +if (c->fc->nb_streams < 1)
>> +return 0;
>> +st = c->fc->streams[c->fc->nb_streams - 1];
>> +sc = st->priv_data;
>>
>>  avio_r8(pb); /* version */
>>  avio_rb24(pb); /* flags */
>> -entries = avio_rb32(pb);
>> +sc->stsd_count = avio_rb32(pb); /* entries */
>> +
>>

[libav-devel] [PATCH] Add MagicYUV decoder

2016-06-06 Thread Vittorio Giovara
From: Paul B Mahol 

Signed-off-by: Paul B Mahol 
Signed-off-by: Vittorio Giovara 
---
Applied Diego's comments.
Vittorio

 Changelog   |   1 +
 configure   |   1 +
 doc/general.texi|   1 +
 libavcodec/Makefile |   1 +
 libavcodec/allcodecs.c  |   1 +
 libavcodec/avcodec.h|   1 +
 libavcodec/codec_desc.c |   7 +
 libavcodec/magicyuv.c   | 469 
 libavformat/isom.c  |   8 +
 libavformat/riff.c  |   1 +
 10 files changed, 491 insertions(+)
 create mode 100644 libavcodec/magicyuv.c

diff --git a/Changelog b/Changelog
index a2a9d46..a3f5376 100644
--- a/Changelog
+++ b/Changelog
@@ -57,6 +57,7 @@ version :
 - Generic OpenMAX IL encoder with support for Raspberry Pi
 - MMAL-accelerated MPEG-2 and VC-1 decoding
 - G.729 raw demuxer
+- MagicYUV decoder
 
 
 version 11:
diff --git a/configure b/configure
index e68cd3e..0066cff 100755
--- a/configure
+++ b/configure
@@ -1984,6 +1984,7 @@ jv_decoder_select="blockdsp"
 lagarith_decoder_select="huffyuvdsp"
 ljpeg_encoder_select="aandcttables idctdsp jpegtables"
 loco_decoder_select="golomb"
+magicyuv_decoder_select="huffyuvdsp"
 mdec_decoder_select="blockdsp idctdsp mpegvideo"
 metasound_decoder_select="lsp mdct sinewin"
 mimic_decoder_select="blockdsp bswapdsp hpeldsp idctdsp"
diff --git a/doc/general.texi b/doc/general.texi
index 15e4a66..a6a6db6 100644
--- a/doc/general.texi
+++ b/doc/general.texi
@@ -672,6 +672,7 @@ following image formats are supported:
 @item LucasArts SANM @tab @tab  X
 @tab Used in LucasArts SMUSH animations.
 @item lossless MJPEG @tab  X  @tab  X
+@item MagicYUV Lossless Video @tab@tab  X
 @item Microsoft ATC Screen   @tab @tab  X
 @tab Also known as Microsoft Screen 3.
 @item Microsoft Expression Encoder Screen  @tab @tab  X
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index c9b2b74..8352c97 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -298,6 +298,7 @@ OBJS-$(CONFIG_LJPEG_ENCODER)   += ljpegenc.o 
mjpegenc_common.o
 OBJS-$(CONFIG_LOCO_DECODER)+= loco.o
 OBJS-$(CONFIG_MACE3_DECODER)   += mace.o
 OBJS-$(CONFIG_MACE6_DECODER)   += mace.o
+OBJS-$(CONFIG_MAGICYUV_DECODER)+= magicyuv.o
 OBJS-$(CONFIG_MDEC_DECODER)+= mdec.o mpeg12.o mpeg12data.o
 OBJS-$(CONFIG_METASOUND_DECODER)   += metasound.o metasound_data.o \
   twinvq.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 2b11ef6..bb90627 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -191,6 +191,7 @@ void avcodec_register_all(void)
 REGISTER_DECODER(LAGARITH,  lagarith);
 REGISTER_ENCODER(LJPEG, ljpeg);
 REGISTER_DECODER(LOCO,  loco);
+REGISTER_DECODER(MAGICYUV,  magicyuv);
 REGISTER_DECODER(MDEC,  mdec);
 REGISTER_DECODER(MIMIC, mimic);
 REGISTER_ENCDEC (MJPEG, mjpeg);
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index f33b7e5..00cf4af 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -389,6 +389,7 @@ enum AVCodecID {
 AV_CODEC_ID_DXV,
 AV_CODEC_ID_SCREENPRESSO,
 AV_CODEC_ID_RSCC,
+AV_CODEC_ID_MAGICYUV,
 
 /* various PCM "codecs" */
 AV_CODEC_ID_FIRST_AUDIO = 0x1, ///< A dummy id pointing at the 
start of audio codecs
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index 7fd2cc6..d328ba3 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -1191,6 +1191,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
 .long_name = NULL_IF_CONFIG_SMALL("innoHeim/Rsupport Screen Capture 
Codec"),
 .props = AV_CODEC_PROP_LOSSLESS,
 },
+{
+.id= AV_CODEC_ID_MAGICYUV,
+.type  = AVMEDIA_TYPE_VIDEO,
+.name  = "magicyuv",
+.long_name = NULL_IF_CONFIG_SMALL("MagicYUV Lossless Video"),
+.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
+},
 
 /* image codecs */
 {
diff --git a/libavcodec/magicyuv.c b/libavcodec/magicyuv.c
new file mode 100644
index 000..c9a1bb9
--- /dev/null
+++ b/libavcodec/magicyuv.c
@@ -0,0 +1,469 @@
+/*
+ * MagicYUV decoder
+ * Copyright (c) 2016 Paul B Mahol
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser Gen

Re: [libav-devel] [PATCH 2/2] fate: Move texture-based decoder tests to a separate file

2016-06-06 Thread Vittorio Giovara
On Sat, Jun 4, 2016 at 4:55 AM, Diego Biurrun  wrote:
> On Fri, Jun 03, 2016 at 02:05:27PM -0400, Vittorio Giovara wrote:
>> ---
>>  tests/Makefile   |  1 +
>>  tests/fate/video.mak | 43 ---
>>  2 files changed, 1 insertion(+), 43 deletions(-)
>
> No, this is not right.

ok, I assume it's because the .mak files are named after the group or
company that created the codec.
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] Return the actual size of the data in AVPacket when decoding VP9 superframe

2016-06-06 Thread Vittorio Giovara
On Sat, Jun 4, 2016 at 7:28 AM, Luca Barbato  wrote:
> On 04/06/16 13:22, y...@dinauz.org wrote:
>> From: typx 
>>
>> According to avcodec.h, avcodec_decode_video2 should return the number of 
>> bytes used if a frame was decoded.
>> The current implementation returns size - used size of all the subframes.
>> This fixes the VLC's bug https://trac.videolan.org/vlc/ticket/16836.
>> ---
>>  libavcodec/vp9.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
>> index 45f0771..c11e9b8 100644
>> --- a/libavcodec/vp9.c
>> +++ b/libavcodec/vp9.c
>> @@ -1251,7 +1251,7 @@ static int vp9_decode_packet(AVCodecContext *avctx, 
>> void *frame,
>>  data += sz;
>>  size -= sz;
>>  }
>> -return size;
>> +return avpkt->size;
>>  }
>>  }
>>
>>
>
> The packet is completely consumed there, so sure, looks fine for me.

What about on line 1262? Is a "return size;" enough?
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH 5/5] fate: Add tests for MagicYUV

2016-06-03 Thread Vittorio Giovara
---
Also these ones could maybe better be in magicyuv.mak?
Vittorio

 tests/fate/video.mak   | 19 +++
 tests/ref/fate/magicyuv-rgb|  2 ++
 tests/ref/fate/magicyuv-rgba   |  2 ++
 tests/ref/fate/magicyuv-y400i  |  2 ++
 tests/ref/fate/magicyuv-y420   |  2 ++
 tests/ref/fate/magicyuv-y422i  |  2 ++
 tests/ref/fate/magicyuv-y444   |  2 ++
 tests/ref/fate/magicyuv-yi |  2 ++
 8 files changed, 33 insertions(+)
 create mode 100644 tests/ref/fate/magicyuv-rgb
 create mode 100644 tests/ref/fate/magicyuv-rgba
 create mode 100644 tests/ref/fate/magicyuv-y400i
 create mode 100644 tests/ref/fate/magicyuv-y420
 create mode 100644 tests/ref/fate/magicyuv-y422i
 create mode 100644 tests/ref/fate/magicyuv-y444
 create mode 100644 tests/ref/fate/magicyuv-yi

diff --git a/tests/fate/video.mak b/tests/fate/video.mak
index 74a22eb..746ce02 100644
--- a/tests/fate/video.mak
+++ b/tests/fate/video.mak
@@ -156,6 +156,25 @@ fate-kgv1: CMD = framecrc -i 
$(TARGET_SAMPLES)/kega/kgv1.avi -pix_fmt rgb555le -
 FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, KMVC) += fate-kmvc
 fate-kmvc: CMD = framecrc -i $(TARGET_SAMPLES)/KMVC/LOGO1.AVI -an -t 3 
-pix_fmt rgb24
 
+FATE_MAGICYUV += fate-magicyuv-yi \
+ fate-magicyuv-y400i  \
+ fate-magicyuv-y420   \
+ fate-magicyuv-y422i  \
+ fate-magicyuv-y444   \
+ fate-magicyuv-rgba   \
+ fate-magicyuv-rgb
+
+FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, MAGICYUV) += $(FATE_MAGICYUV)
+fate-magicyuv: $(FATE_MAGICYUV)
+
+fate-magicyuv-rgb: CMD = framecrc -i $(TARGET_SAMPLES)/magy/magy_rgb_median.avi
+fate-magicyuv-rgba: CMD = framecrc -i 
$(TARGET_SAMPLES)/magy/magy_rgba_gradient.avi
+fate-magicyuv-y400i: CMD = framecrc -i 
$(TARGET_SAMPLES)/magy/magy_yuv400_gradient_interlaced.avi
+fate-magicyuv-y420: CMD = framecrc -i 
$(TARGET_SAMPLES)/magy/magy_yuv420_median.avi
+fate-magicyuv-y422i: CMD = framecrc -i 
$(TARGET_SAMPLES)/magy/magy_yuv422_median_interlaced.avi
+fate-magicyuv-yi: CMD = framecrc -i 
$(TARGET_SAMPLES)/magy/magy_yuv_left_interlaced.avi
+fate-magicyuv-y444: CMD = framecrc -i 
$(TARGET_SAMPLES)/magy/magy_yuv444_left.avi
+
 FATE_SAMPLES_AVCONV-$(call DEMDEC, EA, MDEC) += fate-mdec
 fate-mdec: CMD = framecrc -idct simple -i 
$(TARGET_SAMPLES)/ea-dct/NFS2Esprit-partial.dct -an
 
diff --git a/tests/ref/fate/magicyuv-rgb b/tests/ref/fate/magicyuv-rgb
new file mode 100644
index 000..a52574a
--- /dev/null
+++ b/tests/ref/fate/magicyuv-rgb
@@ -0,0 +1,2 @@
+#tb 0: 100/2397
+0,  0,  0,1,   144768, 0x497c8ce1
diff --git a/tests/ref/fate/magicyuv-rgba b/tests/ref/fate/magicyuv-rgba
new file mode 100644
index 000..6cad8e0
--- /dev/null
+++ b/tests/ref/fate/magicyuv-rgba
@@ -0,0 +1,2 @@
+#tb 0: 100/2397
+0,  0,  0,1,   193024, 0x7e1b7233
diff --git a/tests/ref/fate/magicyuv-y400i b/tests/ref/fate/magicyuv-y400i
new file mode 100644
index 000..4c8fe7e
--- /dev/null
+++ b/tests/ref/fate/magicyuv-y400i
@@ -0,0 +1,2 @@
+#tb 0: 100/2397
+0,  0,  0,1,48256, 0x368b93f2
diff --git a/tests/ref/fate/magicyuv-y420 b/tests/ref/fate/magicyuv-y420
new file mode 100644
index 000..3145e8a
--- /dev/null
+++ b/tests/ref/fate/magicyuv-y420
@@ -0,0 +1,2 @@
+#tb 0: 100/2397
+0,  0,  0,1,72384, 0x59a87842
diff --git a/tests/ref/fate/magicyuv-y422i b/tests/ref/fate/magicyuv-y422i
new file mode 100644
index 000..2a7af47
--- /dev/null
+++ b/tests/ref/fate/magicyuv-y422i
@@ -0,0 +1,2 @@
+#tb 0: 100/2397
+0,  0,  0,1,96512, 0xe84751be
diff --git a/tests/ref/fate/magicyuv-y444 b/tests/ref/fate/magicyuv-y444
new file mode 100644
index 000..ee836c2
--- /dev/null
+++ b/tests/ref/fate/magicyuv-y444
@@ -0,0 +1,2 @@
+#tb 0: 100/2397
+0,  0,  0,1,   144768, 0xef48043f
diff --git a/tests/ref/fate/magicyuv-yi b/tests/ref/fate/magicyuv-yi
new file mode 100644
index 000..bc3c702
--- /dev/null
+++ b/tests/ref/fate/magicyuv-yi
@@ -0,0 +1,2 @@
+#tb 0: 100/2397
+0,  0,  0,1,   193024, 0x5292ecec
-- 
2.8.3

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH 3/5] fate: Move Duck Truemotion 1 and 2 tests to vpx.mak

2016-06-03 Thread Vittorio Giovara
---
Alternatively I can move them to duck.mak, but they seem closely related.
Vittorio

 tests/fate/video.mak | 12 
 tests/fate/vpx.mak   | 12 
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/tests/fate/video.mak b/tests/fate/video.mak
index a524500..74a22eb 100644
--- a/tests/fate/video.mak
+++ b/tests/fate/video.mak
@@ -94,18 +94,6 @@ fate-delphine-cin-video: CMD = framecrc -i 
$(TARGET_SAMPLES)/delphine-cin/LOGO-p
 FATE_SAMPLES_AVCONV-$(call DEMDEC, ANM, ANM) += fate-deluxepaint-anm
 fate-deluxepaint-anm: CMD = framecrc -i 
$(TARGET_SAMPLES)/deluxepaint-anm/INTRO1.ANM -pix_fmt rgb24
 
-FATE_TRUEMOTION1 += fate-truemotion1-15
-fate-truemotion1-15: CMD = framecrc -i $(TARGET_SAMPLES)/duck/phant2-940.duk 
-pix_fmt rgb24 -an
-
-FATE_TRUEMOTION1 += fate-truemotion1-24
-fate-truemotion1-24: CMD = framecrc -i 
$(TARGET_SAMPLES)/duck/sonic3dblast_intro-partial.avi -pix_fmt rgb24 -an
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, TRUEMOTION1) += $(FATE_TRUEMOTION1)
-fate-truemotion1: $(FATE_TRUEMOTION1)
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, TRUEMOTION2) += fate-truemotion2
-fate-truemotion2: CMD = framecrc -i $(TARGET_SAMPLES)/duck/tm20.avi
-
 FATE_DXA += fate-dxa-feeble
 fate-dxa-feeble: CMD = framecrc -i $(TARGET_SAMPLES)/dxa/meetsquid.dxa -t 2 
-pix_fmt rgb24 -an
 
diff --git a/tests/fate/vpx.mak b/tests/fate/vpx.mak
index b9c7c20..0586562 100644
--- a/tests/fate/vpx.mak
+++ b/tests/fate/vpx.mak
@@ -1,3 +1,15 @@
+FATE_TRUEMOTION1 += fate-truemotion1-15
+fate-truemotion1-15: CMD = framecrc -i $(TARGET_SAMPLES)/duck/phant2-940.duk 
-pix_fmt rgb24 -an
+
+FATE_TRUEMOTION1 += fate-truemotion1-24
+fate-truemotion1-24: CMD = framecrc -i 
$(TARGET_SAMPLES)/duck/sonic3dblast_intro-partial.avi -pix_fmt rgb24 -an
+
+FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, TRUEMOTION1) += $(FATE_TRUEMOTION1)
+fate-truemotion1: $(FATE_TRUEMOTION1)
+
+FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, TRUEMOTION2) += fate-truemotion2
+fate-truemotion2: CMD = framecrc -i $(TARGET_SAMPLES)/duck/tm20.avi
+
 FATE_VP3-$(call DEMDEC, MATROSKA, THEORA) += fate-theora-coeff-level64
 fate-theora-coeff-level64: CMD = framecrc -flags +bitexact -i 
$(TARGET_SAMPLES)/vp3/coeff_level64.mkv
 
-- 
2.8.3

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH 1/5] Add MagicYUV decoder

2016-06-03 Thread Vittorio Giovara
From: Paul B Mahol 

Signed-off-by: Paul B Mahol 
Signed-off-by: Vittorio Giovara 
---
Needs version bump.
Vittorio

 Changelog   |   1 +
 configure   |   1 +
 doc/general.texi|   1 +
 libavcodec/Makefile |   1 +
 libavcodec/allcodecs.c  |   1 +
 libavcodec/avcodec.h|   1 +
 libavcodec/codec_desc.c |   7 +
 libavcodec/magicyuv.c   | 464 
 libavformat/isom.c  |   8 +
 libavformat/riff.c  |   1 +
 10 files changed, 486 insertions(+)
 create mode 100644 libavcodec/magicyuv.c

diff --git a/Changelog b/Changelog
index a2a9d46..a3f5376 100644
--- a/Changelog
+++ b/Changelog
@@ -57,6 +57,7 @@ version :
 - Generic OpenMAX IL encoder with support for Raspberry Pi
 - MMAL-accelerated MPEG-2 and VC-1 decoding
 - G.729 raw demuxer
+- MagicYUV decoder
 
 
 version 11:
diff --git a/configure b/configure
index e68cd3e..0066cff 100755
--- a/configure
+++ b/configure
@@ -1984,6 +1984,7 @@ jv_decoder_select="blockdsp"
 lagarith_decoder_select="huffyuvdsp"
 ljpeg_encoder_select="aandcttables idctdsp jpegtables"
 loco_decoder_select="golomb"
+magicyuv_decoder_select="huffyuvdsp"
 mdec_decoder_select="blockdsp idctdsp mpegvideo"
 metasound_decoder_select="lsp mdct sinewin"
 mimic_decoder_select="blockdsp bswapdsp hpeldsp idctdsp"
diff --git a/doc/general.texi b/doc/general.texi
index 15e4a66..a6a6db6 100644
--- a/doc/general.texi
+++ b/doc/general.texi
@@ -672,6 +672,7 @@ following image formats are supported:
 @item LucasArts SANM @tab @tab  X
 @tab Used in LucasArts SMUSH animations.
 @item lossless MJPEG @tab  X  @tab  X
+@item MagicYUV Lossless Video @tab@tab  X
 @item Microsoft ATC Screen   @tab @tab  X
 @tab Also known as Microsoft Screen 3.
 @item Microsoft Expression Encoder Screen  @tab @tab  X
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index c9b2b74..8352c97 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -298,6 +298,7 @@ OBJS-$(CONFIG_LJPEG_ENCODER)   += ljpegenc.o 
mjpegenc_common.o
 OBJS-$(CONFIG_LOCO_DECODER)+= loco.o
 OBJS-$(CONFIG_MACE3_DECODER)   += mace.o
 OBJS-$(CONFIG_MACE6_DECODER)   += mace.o
+OBJS-$(CONFIG_MAGICYUV_DECODER)+= magicyuv.o
 OBJS-$(CONFIG_MDEC_DECODER)+= mdec.o mpeg12.o mpeg12data.o
 OBJS-$(CONFIG_METASOUND_DECODER)   += metasound.o metasound_data.o \
   twinvq.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 2b11ef6..bb90627 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -191,6 +191,7 @@ void avcodec_register_all(void)
 REGISTER_DECODER(LAGARITH,  lagarith);
 REGISTER_ENCODER(LJPEG, ljpeg);
 REGISTER_DECODER(LOCO,  loco);
+REGISTER_DECODER(MAGICYUV,  magicyuv);
 REGISTER_DECODER(MDEC,  mdec);
 REGISTER_DECODER(MIMIC, mimic);
 REGISTER_ENCDEC (MJPEG, mjpeg);
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index f33b7e5..00cf4af 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -389,6 +389,7 @@ enum AVCodecID {
 AV_CODEC_ID_DXV,
 AV_CODEC_ID_SCREENPRESSO,
 AV_CODEC_ID_RSCC,
+AV_CODEC_ID_MAGICYUV,
 
 /* various PCM "codecs" */
 AV_CODEC_ID_FIRST_AUDIO = 0x1, ///< A dummy id pointing at the 
start of audio codecs
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index 7fd2cc6..d328ba3 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -1191,6 +1191,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
 .long_name = NULL_IF_CONFIG_SMALL("innoHeim/Rsupport Screen Capture 
Codec"),
 .props = AV_CODEC_PROP_LOSSLESS,
 },
+{
+.id= AV_CODEC_ID_MAGICYUV,
+.type  = AVMEDIA_TYPE_VIDEO,
+.name  = "magicyuv",
+.long_name = NULL_IF_CONFIG_SMALL("MagicYUV Lossless Video"),
+.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
+},
 
 /* image codecs */
 {
diff --git a/libavcodec/magicyuv.c b/libavcodec/magicyuv.c
new file mode 100644
index 000..76e12ec
--- /dev/null
+++ b/libavcodec/magicyuv.c
@@ -0,0 +1,464 @@
+/*
+ * MagicYUV decoder
+ * Copyright (c) 2016 Paul B Mahol
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Publi

[libav-devel] [PATCH 4/5] fate: Add TrueMotion 2 RT tests

2016-06-03 Thread Vittorio Giovara
---
 tests/fate/vpx.mak| 12 
 tests/ref/fate/truemotion2rt-high | 2 ++
 tests/ref/fate/truemotion2rt-low  | 2 ++
 tests/ref/fate/truemotion2rt-mid  | 2 ++
 4 files changed, 63 insertions(+)
 create mode 100644 tests/ref/fate/truemotion2rt-high
 create mode 100644 tests/ref/fate/truemotion2rt-low
 create mode 100644 tests/ref/fate/truemotion2rt-mid

diff --git a/tests/fate/vpx.mak b/tests/fate/vpx.mak
index 0586562..75248ec 100644
--- a/tests/fate/vpx.mak
+++ b/tests/fate/vpx.mak
@@ -10,6 +10,18 @@ fate-truemotion1: $(FATE_TRUEMOTION1)
 FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, TRUEMOTION2) += fate-truemotion2
 fate-truemotion2: CMD = framecrc -i $(TARGET_SAMPLES)/duck/tm20.avi
 
+FATE_TRUEMOTION2RT += fate-truemotion2rt-low
+fate-truemotion2rt-low: CMD = framecrc -i $(TARGET_SAMPLES)/duck/tr20_low.avi 
-an
+
+FATE_TRUEMOTION2RT += fate-truemotion2rt-mid
+fate-truemotion2rt-mid: CMD = framecrc -i $(TARGET_SAMPLES)/duck/tr20_mid.avi 
-an
+
+FATE_TRUEMOTION2RT += fate-truemotion2rt-high
+fate-truemotion2rt-high: CMD = framecrc -i 
$(TARGET_SAMPLES)/duck/tr20_high.avi -an
+
+FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, TRUEMOTION2RT) += $(FATE_TRUEMOTION2RT)
+fate-truemotion2rt: $(FATE_TRUEMOTION2RT)
+
 FATE_VP3-$(call DEMDEC, MATROSKA, THEORA) += fate-theora-coeff-level64
 fate-theora-coeff-level64: CMD = framecrc -flags +bitexact -i 
$(TARGET_SAMPLES)/vp3/coeff_level64.mkv
 
diff --git a/tests/ref/fate/truemotion2rt-high 
b/tests/ref/fate/truemotion2rt-high
new file mode 100644
index 000..ec549de
--- /dev/null
+++ b/tests/ref/fate/truemotion2rt-high
@@ -0,0 +1,13 @@
+#tb 0: 100/2397
+0,  0,  0,1,54288, 0xbb88db84
diff --git a/tests/ref/fate/truemotion2rt-low b/tests/ref/fate/truemotion2rt-low
new file mode 100644
index 000..df40693
--- /dev/null
+++ b/tests/ref/fate/truemotion2rt-low
@@ -0,0 +1,13 @@
+#tb 0: 100/2397
+0,  0,  0,1,54288, 0x94310459
diff --git a/tests/ref/fate/truemotion2rt-mid b/tests/ref/fate/truemotion2rt-mid
new file mode 100644
index 000..5d15883
--- /dev/null
+++ b/tests/ref/fate/truemotion2rt-mid
@@ -0,0 +1,25 @@
+#tb 0: 100/2397
+0,  0,  0,1,45864, 0x6c39a9e0
-- 
2.8.3

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH 2/5] Add TrueMotion 2.0 Real Time decoder

2016-06-03 Thread Vittorio Giovara
From: Paul B Mahol 

Signed-off-by: Paul B Mahol 
Signed-off-by: Vittorio Giovara 
---
Needs version bump.
Vittorio

 Changelog  |   1 +
 doc/general.texi   |   2 +
 libavcodec/Makefile|   1 +
 libavcodec/allcodecs.c |   1 +
 libavcodec/avcodec.h   |   1 +
 libavcodec/codec_desc.c|   7 ++
 libavcodec/truemotion2rt.c | 227 +
 libavformat/riff.c |   1 +
 8 files changed, 241 insertions(+)
 create mode 100644 libavcodec/truemotion2rt.c

diff --git a/Changelog b/Changelog
index a3f5376..ac4c725 100644
--- a/Changelog
+++ b/Changelog
@@ -58,6 +58,7 @@ version :
 - MMAL-accelerated MPEG-2 and VC-1 decoding
 - G.729 raw demuxer
 - MagicYUV decoder
+- Duck TrueMotion 2.0 Real Time decoder
 
 
 version 11:
diff --git a/doc/general.texi b/doc/general.texi
index a6a6db6..0590c23 100644
--- a/doc/general.texi
+++ b/doc/general.texi
@@ -607,6 +607,8 @@ following image formats are supported:
 @tab fourcc: DUCK
 @item Duck TrueMotion 2.0@tab @tab  X
 @tab fourcc: TM20
+@item Duck TrueMotion 2.0 RT @tab @tab  X
+@tab fourcc: TR20
 @item DV (Digital Video) @tab  X  @tab  X
 @item Dxtory capture format  @tab @tab  X
 @item Feeble Files/ScummVM DXA  @tab @tab  X
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 8352c97..1f2096c 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -438,6 +438,7 @@ OBJS-$(CONFIG_TIFF_ENCODER)+= tiffenc.o rle.o 
lzwenc.o
 OBJS-$(CONFIG_TMV_DECODER) += tmv.o cga_data.o
 OBJS-$(CONFIG_TRUEMOTION1_DECODER) += truemotion1.o
 OBJS-$(CONFIG_TRUEMOTION2_DECODER) += truemotion2.o
+OBJS-$(CONFIG_TRUEMOTION2RT_DECODER)   += truemotion2rt.o
 OBJS-$(CONFIG_TRUESPEECH_DECODER)  += truespeech.o
 OBJS-$(CONFIG_TSCC_DECODER)+= tscc.o msrledec.o
 OBJS-$(CONFIG_TSCC2_DECODER)   += tscc2.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index bb90627..6fa1617 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -265,6 +265,7 @@ void avcodec_register_all(void)
 REGISTER_DECODER(TMV,   tmv);
 REGISTER_DECODER(TRUEMOTION1,   truemotion1);
 REGISTER_DECODER(TRUEMOTION2,   truemotion2);
+REGISTER_DECODER(TRUEMOTION2RT, truemotion2rt);
 REGISTER_DECODER(TSCC,  tscc);
 REGISTER_DECODER(TSCC2, tscc2);
 REGISTER_DECODER(TXD,   txd);
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 00cf4af..aebdc0f 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -390,6 +390,7 @@ enum AVCodecID {
 AV_CODEC_ID_SCREENPRESSO,
 AV_CODEC_ID_RSCC,
 AV_CODEC_ID_MAGICYUV,
+AV_CODEC_ID_TRUEMOTION2RT,
 
 /* various PCM "codecs" */
 AV_CODEC_ID_FIRST_AUDIO = 0x1, ///< A dummy id pointing at the 
start of audio codecs
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index d328ba3..bb5ecef 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -1198,6 +1198,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
 .long_name = NULL_IF_CONFIG_SMALL("MagicYUV Lossless Video"),
 .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
 },
+{
+.id= AV_CODEC_ID_TRUEMOTION2RT,
+.type  = AVMEDIA_TYPE_VIDEO,
+.name  = "truemotion2rt",
+.long_name = NULL_IF_CONFIG_SMALL("Duck TrueMotion 2.0 Real Time"),
+.props = AV_CODEC_PROP_LOSSY,
+},
 
 /* image codecs */
 {
diff --git a/libavcodec/truemotion2rt.c b/libavcodec/truemotion2rt.c
new file mode 100644
index 000..083a7df
--- /dev/null
+++ b/libavcodec/truemotion2rt.c
@@ -0,0 +1,227 @@
+/*
+ * Duck TrueMotion 2.0 Real Time Decoder
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include 
+#include 
+#include 
+
+#include "libavutil/imgutils.h"
+#include "libavutil/internal.h"
+#include "libavutil/intreadwrite.h"
+#include "libavutil/mem.h"
+
+#include "avcodec.h"
+#define BITSTREAM_READER_LE
+#include "get_bits.h"
+#include "internal.h"
+
+typedef struct TrueMotio

[libav-devel] [PATCH] fate: Move Canopus decoder tests to a separate file

2016-06-03 Thread Vittorio Giovara
---
Resend preserving the entries order.
Vittorio

 tests/Makefile|  1 +
 tests/fate/canopus.mak| 34 ++
 tests/fate/lossless-video.mak | 12 
 tests/fate/video.mak  | 21 -
 4 files changed, 35 insertions(+), 33 deletions(-)
 create mode 100644 tests/fate/canopus.mak

diff --git a/tests/Makefile b/tests/Makefile
index 82b7e0f..36a3a72 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -72,6 +72,7 @@ include $(SRC_PATH)/tests/fate/amrwb.mak
 include $(SRC_PATH)/tests/fate/atrac.mak
 include $(SRC_PATH)/tests/fate/audio.mak
 include $(SRC_PATH)/tests/fate/bmp.mak
+include $(SRC_PATH)/tests/fate/canopus.mak
 include $(SRC_PATH)/tests/fate/cdxl.mak
 include $(SRC_PATH)/tests/fate/checkasm.mak
 include $(SRC_PATH)/tests/fate/cover-art.mak
diff --git a/tests/fate/canopus.mak b/tests/fate/canopus.mak
new file mode 100644
index 000..1f24a4c
--- /dev/null
+++ b/tests/fate/canopus.mak
@@ -0,0 +1,34 @@
+#lossless
+FATE_CANOPUS_CLLC += fate-canopus-cllc-argb
+fate-canopus-cllc-argb: CMD = framecrc -i 
$(TARGET_SAMPLES)/cllc/sample-cllc-argb.avi
+
+FATE_CANOPUS_CLLC += fate-canopus-cllc-rgb
+fate-canopus-cllc-rgb: CMD = framecrc -i 
$(TARGET_SAMPLES)/cllc/sample-cllc-rgb.avi
+
+FATE_CANOPUS_CLLC += fate-canopus-cllc-yuy2-noblock
+fate-canopus-cllc-yuy2-noblock: CMD = framecrc -i 
$(TARGET_SAMPLES)/cllc/sample-cllc-yuy2-noblock.avi
+
+FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, CLLC) += $(FATE_CANOPUS_CLLC)
+fate-canopus-cllc: $(FATE_CANOPUS_CLLC)
+
+#lossy
+FATE_CANOPUS_HQ_HQA += fate-canopus-hq_hqa-hq
+fate-canopus-hq_hqa-hq: CMD = framecrc -i $(TARGET_SAMPLES)/canopus/hq.avi
+
+FATE_CANOPUS_HQ_HQA += fate-canopus-hq_hqa-hqa
+fate-canopus-hq_hqa-hqa: CMD = framecrc -i $(TARGET_SAMPLES)/canopus/hqa.avi
+
+FATE_CANOPUS_HQ_HQA += fate-canopus-hq_hqa-inter
+fate-canopus-hq_hqa-inter: CMD = framecrc -i 
$(TARGET_SAMPLES)/canopus/hq25i.avi
+
+FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, HQ_HQA) += $(FATE_CANOPUS_HQ_HQA)
+fate-canopus-hq_hqa: $(FATE_CANOPUS_HQ_HQA)
+
+FATE_CANOPUS_HQX += fate-canopus-hqx422
+fate-canopus-hqx422: CMD = framecrc -i $(TARGET_SAMPLES)/canopus/hqx422.avi 
-pix_fmt yuv422p16be -an
+
+FATE_CANOPUS_HQX += fate-canopus-hqx422a
+fate-canopus-hqx422a: CMD = framecrc -i $(TARGET_SAMPLES)/canopus/hqx422a.avi 
-pix_fmt yuv422p16be -an
+
+FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, HQX) += $(FATE_CANOPUS_HQX)
+fate-canopus-hqx: $(FATE_CANOPUS_HQX)
diff --git a/tests/fate/lossless-video.mak b/tests/fate/lossless-video.mak
index d5b10b3..f039492 100644
--- a/tests/fate/lossless-video.mak
+++ b/tests/fate/lossless-video.mak
@@ -1,15 +1,3 @@
-FATE_CANOPUS_CLLC += fate-canopus-cllc-argb
-fate-canopus-cllc-argb: CMD = framecrc -i 
$(TARGET_SAMPLES)/cllc/sample-cllc-argb.avi
-
-FATE_CANOPUS_CLLC += fate-canopus-cllc-rgb
-fate-canopus-cllc-rgb: CMD = framecrc -i 
$(TARGET_SAMPLES)/cllc/sample-cllc-rgb.avi
-
-FATE_CANOPUS_CLLC += fate-canopus-cllc-yuy2-noblock
-fate-canopus-cllc-yuy2-noblock: CMD = framecrc -i 
$(TARGET_SAMPLES)/cllc/sample-cllc-yuy2-noblock.avi
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, CLLC) += $(FATE_CANOPUS_CLLC)
-fate-canopus-cllc: $(FATE_CANOPUS_CLLC)
-
 FATE_LAGARITH += fate-lagarith-rgb24
 fate-lagarith-rgb24: CMD = framecrc -i $(TARGET_SAMPLES)/lagarith/lag-rgb24.avi
 
diff --git a/tests/fate/video.mak b/tests/fate/video.mak
index ef1d41d..df3ce5c 100644
--- a/tests/fate/video.mak
+++ b/tests/fate/video.mak
@@ -55,27 +55,6 @@ fate-bink-video: $(FATE_BINK_VIDEO)
 FATE_SAMPLES_AVCONV-$(call DEMDEC, BMV, BMV_VIDEO) += fate-bmv-video
 fate-bmv-video: CMD = framecrc -i $(TARGET_SAMPLES)/bmv/SURFING-partial.BMV 
-pix_fmt rgb24 -an
 
-FATE_CANOPUS_HQ_HQA += fate-canopus-hq_hqa-hq
-fate-canopus-hq_hqa-hq: CMD = framecrc -i $(TARGET_SAMPLES)/canopus/hq.avi
-
-FATE_CANOPUS_HQ_HQA += fate-canopus-hq_hqa-hqa
-fate-canopus-hq_hqa-hqa: CMD = framecrc -i $(TARGET_SAMPLES)/canopus/hqa.avi
-
-FATE_CANOPUS_HQ_HQA += fate-canopus-hq_hqa-inter
-fate-canopus-hq_hqa-inter: CMD = framecrc -i 
$(TARGET_SAMPLES)/canopus/hq25i.avi
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, HQ_HQA) += $(FATE_CANOPUS_HQ_HQA)
-fate-canopus-hq_hqa: $(FATE_CANOPUS_HQ_HQA)
-
-FATE_CANOPUS_HQX += fate-canopus-hqx422
-fate-canopus-hqx422: CMD = framecrc -i $(TARGET_SAMPLES)/canopus/hqx422.avi 
-pix_fmt yuv422p16be -an
-
-FATE_CANOPUS_HQX += fate-canopus-hqx422a
-fate-canopus-hqx422a: CMD = framecrc -i $(TARGET_SAMPLES)/canopus/hqx422a.avi 
-pix_fmt yuv422p16be -an
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, HQX) += $(FATE_CANOPUS_HQX)
-fate-canopus-hqx: $(FATE_CANOPUS_HQX)
-
 FATE_SAMPLES_AVCONV-$(call DEMDEC, MPEGPS, CAVS) += fate-cavs
 fate-cavs: CMD = framecrc -i $(TARGET_SAMPLES)/cavs/cavs.mpg -an
 
-- 
2.8.3

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH 2/2] fate: Move texture-based decoder tests to a separate file

2016-06-03 Thread Vittorio Giovara
---
 tests/Makefile   |  1 +
 tests/fate/video.mak | 43 ---
 2 files changed, 1 insertion(+), 43 deletions(-)

diff --git a/tests/Makefile b/tests/Makefile
index 36a3a72..5059176 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -108,6 +108,7 @@ include $(SRC_PATH)/tests/fate/qt.mak
 include $(SRC_PATH)/tests/fate/qtrle.mak
 include $(SRC_PATH)/tests/fate/real.mak
 include $(SRC_PATH)/tests/fate/screen.mak
+include $(SRC_PATH)/tests/fate/texture.mak
 include $(SRC_PATH)/tests/fate/utvideo.mak
 include $(SRC_PATH)/tests/fate/video.mak
 include $(SRC_PATH)/tests/fate/voice.mak
diff --git a/tests/fate/video.mak b/tests/fate/video.mak
index 2941624..74a22eb 100644
--- a/tests/fate/video.mak
+++ b/tests/fate/video.mak
@@ -102,22 +102,6 @@ fate-dxa-scummvm: CMD = framecrc -i 
$(TARGET_SAMPLES)/dxa/scummvm.dxa -pix_fmt r
 
 FATE_SAMPLES_AVCONV-$(call DEMDEC, DXA, DXA) += $(FATE_DXA)
 fate-dxa: $(FATE_DXA)
-
-FATE_DXV += fate-dxv-dxt1
-fate-dxv-dxt1: CMD = framecrc -i $(TARGET_SAMPLES)/dxv/dxv-na.mov
-
-FATE_DXV += fate-dxv-dxt5
-fate-dxv-dxt5: CMD = framecrc -i $(TARGET_SAMPLES)/dxv/dxv-wa.mov
-
-FATE_DXV += fate-dxv3-dxt1
-fate-dxv3-dxt1: CMD = framecrc -i $(TARGET_SAMPLES)/dxv/dxv3-nqna.mov
-
-FATE_DXV += fate-dxv3-dxt5
-fate-dxv3-dxt5: CMD = framecrc -i $(TARGET_SAMPLES)/dxv/dxv3-nqwa.mov
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, MOV, DXV) += $(FATE_DXV)
-fate-dxv: $(FATE_DXV)
-
 FATE_SAMPLES_AVCONV-$(call DEMDEC, SEGAFILM, CINEPAK) += fate-film-cvid
 fate-film-cvid: CMD = framecrc -i $(TARGET_SAMPLES)/film/logo-capcom.cpk -an
 
@@ -142,21 +126,6 @@ fate-id-cin-video: CMD = framecrc -i 
$(TARGET_SAMPLES)/idcin/idlog-2MB.cin -pix_
 FATE_SAMPLES_AVCONV-$(call ENCDEC, ROQ PGMYUV, ROQ IMAGE2) += 
fate-idroq-video-encode
 fate-idroq-video-encode: CMD = md5 -f image2 -vcodec pgmyuv -i 
$(TARGET_SAMPLES)/ffmpeg-synthetic/vsynth1/%02d.pgm -sws_flags +bitexact -vf 
pad=512:512:80:112 -f roq -t 0.2
 
-FATE_HAP += fate-hap1
-fate-hap1: CMD = framecrc -i $(TARGET_SAMPLES)/hap/hap1.mov
-
-FATE_HAP += fate-hap5
-fate-hap5: CMD = framecrc -i $(TARGET_SAMPLES)/hap/hap5.mov
-
-FATE_HAP += fate-hapy
-fate-hapy: CMD = framecrc -i $(TARGET_SAMPLES)/hap/hapy.mov
-
-FATE_HAP += fate-hap-chunk
-fate-hap-chunk: CMD = framecrc -i $(TARGET_SAMPLES)/hap/hapy-12-chunks.mov
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, MOV, HAP) += $(FATE_HAP)
-fate-hap: $(FATE_HAP)
-
 FATE_IFF-$(CONFIG_IFF_BYTERUN1_DECODER) += fate-iff-byterun1
 fate-iff-byterun1: CMD = framecrc -i $(TARGET_SAMPLES)/iff/ASH.LBM -pix_fmt 
rgb24
 
@@ -266,18 +235,6 @@ fate-tiertex-seq: CMD = framecrc -i 
$(TARGET_SAMPLES)/tiertex-seq/Gameover.seq -
 FATE_SAMPLES_AVCONV-$(call DEMDEC, TMV, TMV) += fate-tmv
 fate-tmv: CMD = framecrc -i $(TARGET_SAMPLES)/tmv/pop-partial.tmv -pix_fmt 
rgb24
 
-FATE_TXD += fate-txd-16bpp
-fate-txd-16bpp: CMD = framecrc -i $(TARGET_SAMPLES)/txd/misc.txd -an
-
-FATE_TXD += fate-txd-odd
-fate-txd-odd: CMD = framecrc -i $(TARGET_SAMPLES)/txd/odd.txd -an
-
-FATE_TXD += fate-txd-pal8
-fate-txd-pal8: CMD = framecrc -i $(TARGET_SAMPLES)/txd/outro.txd -pix_fmt 
rgb24 -an
-
-FATE_SAMPLES_AVCONV-$(call DEMDEC, TXD, TXD) += $(FATE_TXD)
-fate-txd: $(FATE_TXD)
-
 FATE_SAMPLES_AVCONV-$(call DEMDEC, AVI, ULTI) += fate-ulti
 fate-ulti: CMD = framecrc -i $(TARGET_SAMPLES)/ulti/hit12w.avi -an
 
-- 
2.8.3

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


<    4   5   6   7   8   9   10   11   12   13   >