Re: [FFmpeg-devel] [PATCH] avcodec/aacenc_quantization: Fix undefined behavior and instead detect and print an error

2016-03-29 Thread Claudio Freire
On Wed, Mar 30, 2016 at 1:18 AM, Claudio Freire  wrote:
> On Tue, Mar 29, 2016 at 10:51 PM, Michael Niedermayer
>  wrote:
>> This is a hotfix and not a real fix of the underlaying bug
>> The underlaying bug is ATM not fully understood
>>
>> iam not sure if we should apply this or not
>>
>> Signed-off-by: Michael Niedermayer 
>> ---
>>  libavcodec/aacenc_quantization.h |   13 +++--
>>  1 file changed, 11 insertions(+), 2 deletions(-)
>>
>> diff --git a/libavcodec/aacenc_quantization.h 
>> b/libavcodec/aacenc_quantization.h
>> index 4250407..d367be0 100644
>> --- a/libavcodec/aacenc_quantization.h
>> +++ b/libavcodec/aacenc_quantization.h
>> @@ -141,8 +141,17 @@ static av_always_inline float 
>> quantize_and_encode_band_cost_template(
>>  if (BT_ESC) {
>>  for (j = 0; j < 2; j++) {
>>  if (ff_aac_codebook_vectors[cb-1][curidx*2+j] == 64.0f) 
>> {
>> -int coef = av_clip_uintp2(quant(fabsf(in[i+j]), Q, 
>> ROUNDING), 13);
>> -int len = av_log2(coef);
>> +float a = fabsf(in[i+j]) * Q;
>> +double f = sqrtf(a * sqrtf(a)) + ROUNDING;
>> +int coef, len;
>> +
>> +if (f > INT_MAX || f < 16) {
>> +av_log(NULL, AV_LOG_ERROR, "f %f is out of 
>> range this is a internal error\n", f);
>> +f = INT_MAX;
>> +}
>> +
>> +coef = av_clip_uintp2(f, 13);
>> +len = av_log2(coef);
>>
>>  put_bits(pb, len - 4 + 1, (1 << (len - 4 + 1)) - 2);
>>  put_sbits(pb, len, coef);
>
> Actually I just understood the underlying bug and am testing a fix.
>
> Basically, scalefactors need to be bound by (roughly)
> coef2minsf(maxval), which isn't being done atm, and some signals
> prompt the encoder to pick lower and lower scalefactors trying to
> consume unspent bits that cannot really be consumed.

Try the attached diff instead (I'm not able to reproduce the issue with gcc)
diff --git a/libavcodec/aaccoder_twoloop.h b/libavcodec/aaccoder_twoloop.h
index 397a4db..4747c79 100644
--- a/libavcodec/aaccoder_twoloop.h
+++ b/libavcodec/aaccoder_twoloop.h
@@ -77,7 +77,7 @@ static void search_for_quantizers_twoloop(AVCodecContext 
*avctx,
 int toomanybits, toofewbits;
 char nzs[128];
 uint8_t nextband[128];
-int maxsf[128];
+int maxsf[128], minsf[128];
 float dists[128] = { 0 }, qenergies[128] = { 0 }, uplims[128], 
euplims[128], energies[128];
 float maxvals[128], spread_thr_r[128];
 float min_spread_thr_r, max_spread_thr_r;
@@ -294,11 +294,14 @@ static void search_for_quantizers_twoloop(AVCodecContext 
*avctx,
 abs_pow34_v(s->scoefs, sce->coeffs, 1024);
 ff_quantize_band_cost_cache_init(s);
 
+for (i = 0; i < sizeof(minsf) / sizeof(minsf[0]); ++i)
+minsf[i] = 0;
 for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
 start = w*128;
 for (g = 0;  g < sce->ics.num_swb; g++) {
 const float *scaled = s->scoefs + start;
 maxvals[w*16+g] = find_max_val(sce->ics.group_len[w], 
sce->ics.swb_sizes[g], scaled);
+minsf[w*16+g] = coef2minsf(maxvals[w*16+g]);
 start += sce->ics.swb_sizes[g];
 }
 }
@@ -425,7 +428,7 @@ static void search_for_quantizers_twoloop(AVCodecContext 
*avctx,
 recomprd = 1;
 for (i = 0; i < 128; i++) {
 if (sce->sf_idx[i] > SCALE_ONE_POS) {
-int new_sf = FFMAX(SCALE_ONE_POS, sce->sf_idx[i] - 
qstep);
+int new_sf = FFMAX3(minsf[i], SCALE_ONE_POS, 
sce->sf_idx[i] - qstep);
 if (new_sf != sce->sf_idx[i]) {
 sce->sf_idx[i] = new_sf;
 changed = 1;
@@ -595,7 +598,7 @@ static void search_for_quantizers_twoloop(AVCodecContext 
*avctx,
 int cmb = find_min_book(maxvals[w*16+g], 
sce->sf_idx[w*16+g]);
 int mindeltasf = FFMAX(0, prev - SCALE_MAX_DIFF);
 int maxdeltasf = FFMIN(SCALE_MAX_POS - SCALE_DIV_512, prev 
+ SCALE_MAX_DIFF);
-if ((!cmb || dists[w*16+g] > uplims[w*16+g]) && 
sce->sf_idx[w*16+g] > mindeltasf) {
+if ((!cmb || dists[w*16+g] > uplims[w*16+g]) && 
sce->sf_idx[w*16+g] > FFMAX(mindeltasf, minsf[w*16+g])) {
 /* Try to make sure there is some energy in every 
nonzero band
  * NOTE: This algorithm must be forcibly imbalanced, 
pushing harder
  *  on holes or more distorted bands at first, 
otherwise there's
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org

Re: [FFmpeg-devel] [PATCH] avcodec/aacenc_quantization: Fix undefined behavior and instead detect and print an error

2016-03-29 Thread Claudio Freire
On Tue, Mar 29, 2016 at 10:51 PM, Michael Niedermayer
 wrote:
> This is a hotfix and not a real fix of the underlaying bug
> The underlaying bug is ATM not fully understood
>
> iam not sure if we should apply this or not
>
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/aacenc_quantization.h |   13 +++--
>  1 file changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/libavcodec/aacenc_quantization.h 
> b/libavcodec/aacenc_quantization.h
> index 4250407..d367be0 100644
> --- a/libavcodec/aacenc_quantization.h
> +++ b/libavcodec/aacenc_quantization.h
> @@ -141,8 +141,17 @@ static av_always_inline float 
> quantize_and_encode_band_cost_template(
>  if (BT_ESC) {
>  for (j = 0; j < 2; j++) {
>  if (ff_aac_codebook_vectors[cb-1][curidx*2+j] == 64.0f) {
> -int coef = av_clip_uintp2(quant(fabsf(in[i+j]), Q, 
> ROUNDING), 13);
> -int len = av_log2(coef);
> +float a = fabsf(in[i+j]) * Q;
> +double f = sqrtf(a * sqrtf(a)) + ROUNDING;
> +int coef, len;
> +
> +if (f > INT_MAX || f < 16) {
> +av_log(NULL, AV_LOG_ERROR, "f %f is out of range 
> this is a internal error\n", f);
> +f = INT_MAX;
> +}
> +
> +coef = av_clip_uintp2(f, 13);
> +len = av_log2(coef);
>
>  put_bits(pb, len - 4 + 1, (1 << (len - 4 + 1)) - 2);
>  put_sbits(pb, len, coef);

Actually I just understood the underlying bug and am testing a fix.

Basically, scalefactors need to be bound by (roughly)
coef2minsf(maxval), which isn't being done atm, and some signals
prompt the encoder to pick lower and lower scalefactors trying to
consume unspent bits that cannot really be consumed.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH]Addition of MLP encoder

2016-03-29 Thread Michael Niedermayer
On Wed, Mar 30, 2016 at 06:38:33AM +0530, Disha Singh wrote:
> The most recent patch has been attached. The lpc error persists.
> I have removed some patcheck errors.
> 

[...]

> +/
> + *** Functions that process the data in some way 
> + 
> /
> +
> +#define INT24_MAX ((1 << 23) - 1)
> +#define INT24_MIN (~INT24_MAX)
> +
> +#define MSB_MASK(bits)  (-1u << bits)
> +
> +/** Applies the filter to the current samples, and saves the residual back
> + *  into the samples buffer. If the filter is too bad and overflows the
> + *  maximum amount of bits allowed (24), the samples buffer is left as is and
> + *  the function returns -1.
> + */
> +static int apply_filter(MLPEncodeContext *ctx, unsigned int channel)
> +{
> +FilterParams *fp[NUM_FILTERS] = { 
> >cur_channel_params[channel].filter_params[FIR],
> +  
> >cur_channel_params[channel].filter_params[IIR], };
> +int32_t **filter_state_buffer = 
> (av_malloc((NUM_FILTERS)*sizeof(int32_t*));

doesnt build

CC  libavcodec/mlpenc.o
libavcodec/mlpenc.c: In function ‘mlp_encode_init’:
libavcodec/mlpenc.c:577:5: warning: ‘coded_frame’ is deprecated (declared at 
libavcodec/avcodec.h:2967) [-Wdeprecated-declarations]
libavcodec/mlpenc.c: In function ‘set_filter_params’:
libavcodec/mlpenc.c:1480:35: warning: passing argument 3 of ‘ff_lpc_calc_coefs’ 
makes integer from pointer without a cast [enabled by default]
libavcodec/lpc.h:93:5: note: expected ‘int’ but argument is of type ‘unsigned 
int *’
libavcodec/mlpenc.c: In function ‘apply_filter’:
libavcodec/mlpenc.c:1888:69: error: expected ‘)’ before ‘;’ token
libavcodec/mlpenc.c:2462:1: error: expected declaration or statement at end of 
input
libavcodec/mlpenc.c:1888:15: warning: unused variable ‘filter_state_buffer’ 
[-Wunused-variable]
libavcodec/mlpenc.c:1886:19: warning: unused variable ‘fp’ [-Wunused-variable]
libavcodec/mlpenc.c:2462:1: error: no return statement in function returning 
non-void [-Werror=return-type]
libavcodec/mlpenc.c: At top level:
libavcodec/mlpenc.c:205:19: warning: ‘restart_best_offset’ defined but not used 
[-Wunused-variable]
libavcodec/mlpenc.c:283:12: warning: ‘compare_decoding_params’ defined but not 
used [-Wunused-function]
libavcodec/mlpenc.c:377:13: warning: ‘copy_restart_frame_params’ defined but 
not used [-Wunused-function]
libavcodec/mlpenc.c:438:13: warning: ‘default_decoding_params’ defined but not 
used [-Wunused-function]
libavcodec/mlpenc.c:486:34: warning: ‘mlp_encode_init’ defined but not used 
[-Wunused-function]
libavcodec/mlpenc.c:702:21: warning: ‘bitcount_restart_header’ defined but not 
used [-Wunused-function]
libavcodec/mlpenc.c:746:21: warning: ‘bitcount_decoding_params’ defined but not 
used [-Wunused-function]
libavcodec/mlpenc.c:1242:21: warning: ‘write_access_unit’ defined but not used 
[-Wunused-function]
libavcodec/mlpenc.c:1338:13: warning: ‘input_data’ defined but not used 
[-Wunused-function]
libavcodec/mlpenc.c:1347:13: warning: ‘input_to_sample_buffer’ defined but not 
used [-Wunused-function]
libavcodec/mlpenc.c:1388:13: warning: ‘determine_quant_step_size’ defined but 
not used [-Wunused-function]
libavcodec/mlpenc.c:1496:13: warning: ‘determine_filters’ defined but not used 
[-Wunused-function]
libavcodec/mlpenc.c:1563:13: warning: ‘lossless_matrix_coeffs’ defined but not 
used [-Wunused-function]
libavcodec/mlpenc.c:1812:13: warning: ‘determine_bits’ defined but not used 
[-Wunused-function]

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/2] tests/audiomatch: also print signal vs reference length

2016-03-29 Thread Michael Niedermayer
On Tue, Mar 22, 2016 at 01:43:46PM +0100, Michael Niedermayer wrote:
> Signed-off-by: Michael Niedermayer 
> ---
>  tests/audiomatch.c |2 +-
>  .../fate/audiomatch-afconvert-16000-mono-he-adts   |2 +-
>  .../fate/audiomatch-afconvert-16000-mono-he-m4a|2 +-
>  .../fate/audiomatch-afconvert-16000-mono-lc-adts   |2 +-
>  .../fate/audiomatch-afconvert-16000-mono-lc-m4a|2 +-
>  .../fate/audiomatch-afconvert-16000-stereo-he-adts |2 +-
>  .../fate/audiomatch-afconvert-16000-stereo-he-m4a  |2 +-
>  .../audiomatch-afconvert-16000-stereo-he2-adts |2 +-
>  .../fate/audiomatch-afconvert-16000-stereo-he2-m4a |2 +-
>  .../fate/audiomatch-afconvert-16000-stereo-lc-adts |2 +-
>  .../fate/audiomatch-afconvert-16000-stereo-lc-m4a  |2 +-
>  .../fate/audiomatch-afconvert-44100-mono-he-adts   |2 +-
>  .../fate/audiomatch-afconvert-44100-mono-he-m4a|2 +-
>  .../fate/audiomatch-afconvert-44100-mono-lc-adts   |2 +-
>  .../fate/audiomatch-afconvert-44100-mono-lc-m4a|2 +-
>  .../fate/audiomatch-afconvert-44100-stereo-he-adts |2 +-
>  .../fate/audiomatch-afconvert-44100-stereo-he-m4a  |2 +-
>  .../audiomatch-afconvert-44100-stereo-he2-adts |2 +-
>  .../fate/audiomatch-afconvert-44100-stereo-he2-m4a |2 +-
>  .../fate/audiomatch-afconvert-44100-stereo-lc-adts |2 +-
>  .../fate/audiomatch-afconvert-44100-stereo-lc-m4a  |2 +-
>  tests/ref/fate/audiomatch-dolby-44100-mono-he-mp4  |2 +-
>  tests/ref/fate/audiomatch-dolby-44100-mono-lc-mp4  |2 +-
>  .../ref/fate/audiomatch-dolby-44100-stereo-he-mp4  |2 +-
>  .../ref/fate/audiomatch-dolby-44100-stereo-he2-mp4 |2 +-
>  .../ref/fate/audiomatch-dolby-44100-stereo-lc-mp4  |2 +-
>  tests/ref/fate/audiomatch-faac-16000-mono-lc-adts  |2 +-
>  tests/ref/fate/audiomatch-faac-16000-mono-lc-m4a   |2 +-
>  .../ref/fate/audiomatch-faac-16000-stereo-lc-adts  |2 +-
>  tests/ref/fate/audiomatch-faac-16000-stereo-lc-m4a |2 +-
>  tests/ref/fate/audiomatch-faac-44100-mono-lc-adts  |2 +-
>  tests/ref/fate/audiomatch-faac-44100-mono-lc-m4a   |2 +-
>  .../ref/fate/audiomatch-faac-44100-stereo-lc-adts  |2 +-
>  tests/ref/fate/audiomatch-faac-44100-stereo-lc-m4a |2 +-
>  tests/ref/fate/audiomatch-nero-16000-mono-he-m4a   |2 +-
>  tests/ref/fate/audiomatch-nero-16000-mono-lc-m4a   |2 +-
>  tests/ref/fate/audiomatch-nero-16000-stereo-he-m4a |2 +-
>  .../ref/fate/audiomatch-nero-16000-stereo-he2-m4a  |2 +-
>  tests/ref/fate/audiomatch-nero-16000-stereo-lc-m4a |2 +-
>  tests/ref/fate/audiomatch-nero-44100-mono-he-m4a   |2 +-
>  tests/ref/fate/audiomatch-nero-44100-mono-lc-m4a   |2 +-
>  tests/ref/fate/audiomatch-nero-44100-stereo-he-m4a |2 +-
>  .../ref/fate/audiomatch-nero-44100-stereo-he2-m4a  |2 +-
>  tests/ref/fate/audiomatch-nero-44100-stereo-lc-m4a |2 +-
>  .../fate/audiomatch-quicktime7-44100-stereo-lc-mp4 |2 +-
>  .../fate/audiomatch-quicktimeX-44100-stereo-lc-m4a |2 +-
>  tests/ref/fate/audiomatch-square-aac   |2 +-
>  tests/ref/fate/audiomatch-square-mp3   |2 +-
>  48 files changed, 48 insertions(+), 48 deletions(-)

patchset applied

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

During times of universal deceit, telling the truth becomes a
revolutionary act. -- George Orwell


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 3/6] lavc/audiotoolboxenc: fix iOS build

2016-03-29 Thread crossle song
OK, I'll try your all patch before about audiotoolbox

On Wed, Mar 30, 2016 at 5:01 AM, Rodger Combs 
wrote:

>
> > On Mar 27, 2016, at 21:13, crossle song  wrote:
> >
> > Work well on iPhone 6, but on  iPhone 4S iOS 9.0, return  [aac_at @
> > 0x1702a400] Encode error: -50, can not work
>
> I don't have a test setup for iOS devices (nor a 4S to test on); does this
> case work correctly with your patch, but not mine? What's the full ffmpeg
> command you're using to test? (Or is this using lavc in another
> application?)
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 3/6] lavc/audiotoolboxenc: fix iOS build

2016-03-29 Thread crossle song
Please merge the audiotoolbox patch

On Wed, Mar 30, 2016 at 10:07 AM, crossle song 
wrote:

> OK, I'll try your all patch before about audiotoolbox
>
> On Wed, Mar 30, 2016 at 5:01 AM, Rodger Combs 
> wrote:
>
>>
>> > On Mar 27, 2016, at 21:13, crossle song  wrote:
>> >
>> > Work well on iPhone 6, but on  iPhone 4S iOS 9.0, return  [aac_at @
>> > 0x1702a400] Encode error: -50, can not work
>>
>> I don't have a test setup for iOS devices (nor a 4S to test on); does
>> this case work correctly with your patch, but not mine? What's the full
>> ffmpeg command you're using to test? (Or is this using lavc in another
>> application?)
>> ___
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>
>
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] avcodec/aacenc_quantization: Fix undefined behavior and instead detect and print an error

2016-03-29 Thread Michael Niedermayer
This is a hotfix and not a real fix of the underlaying bug
The underlaying bug is ATM not fully understood

iam not sure if we should apply this or not

Signed-off-by: Michael Niedermayer 
---
 libavcodec/aacenc_quantization.h |   13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/libavcodec/aacenc_quantization.h b/libavcodec/aacenc_quantization.h
index 4250407..d367be0 100644
--- a/libavcodec/aacenc_quantization.h
+++ b/libavcodec/aacenc_quantization.h
@@ -141,8 +141,17 @@ static av_always_inline float 
quantize_and_encode_band_cost_template(
 if (BT_ESC) {
 for (j = 0; j < 2; j++) {
 if (ff_aac_codebook_vectors[cb-1][curidx*2+j] == 64.0f) {
-int coef = av_clip_uintp2(quant(fabsf(in[i+j]), Q, 
ROUNDING), 13);
-int len = av_log2(coef);
+float a = fabsf(in[i+j]) * Q;
+double f = sqrtf(a * sqrtf(a)) + ROUNDING;
+int coef, len;
+
+if (f > INT_MAX || f < 16) {
+av_log(NULL, AV_LOG_ERROR, "f %f is out of range 
this is a internal error\n", f);
+f = INT_MAX;
+}
+
+coef = av_clip_uintp2(f, 13);
+len = av_log2(coef);
 
 put_bits(pb, len - 4 + 1, (1 << (len - 4 + 1)) - 2);
 put_sbits(pb, len, coef);
-- 
1.7.9.5

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


Re: [FFmpeg-devel] [PATCH]Addition of MLP encoder

2016-03-29 Thread Disha Singh
The most recent patch has been attached. The lpc error persists.
I have removed some patcheck errors.

-Disha

On Tue, Mar 29, 2016 at 6:24 AM, Michael Niedermayer  wrote:

> On Tue, Mar 29, 2016 at 03:13:50AM +0530, Disha Singh wrote:
> > What is lpc ?
>
> linear predictive coding
>
>
> > Which lpc type (there are many in libavcodec/lpc.h)should be
> > used for mlp ?
>
> i would guess that doesnt matter and it should at some point become
> a user specified parameter
> you can also look at other encoders which use the lpc code
>
>
> > Also, please tell lpc_passes and precision and max_order
> > value to be specified for mlp.
>
> lpc_passes, is like type
> for the others check what the decoder or codec syntax can handle or
> what some MLP files use (ive no idea either without checking)
>
>
> >
> > In correct order of parameters in old file is causing SIGABRT error in
> line
> > 214 in lpc.h . :(((
>
> [...]
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> Everything should be made as simple as possible, but not simpler.
> -- Albert Einstein
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
>
From 39a1a0faf0755f581a64c7d0148f33f839213ed2 Mon Sep 17 00:00:00 2001
From: dinux5 
Date: Sun, 27 Mar 2016 17:39:57 +0530
Subject: [PATCH] MLP encoder addition.

---
 Changelog  |1 +
 configure  |1 +
 libavcodec/Makefile|1 +
 libavcodec/allcodecs.c |2 +-
 libavcodec/mlp.h   |4 +
 libavcodec/mlpenc.c| 2462 
 5 files changed, 2470 insertions(+), 1 deletion(-)
 create mode 100755 libavcodec/mlpenc.c
 
diff --git a/Changelog b/Changelog
index 0e70724..f34e8dd 100644
--- a/Changelog
+++ b/Changelog
@@ -2,6 +2,7 @@ Entries are sorted chronologically from oldest to youngest within each release,
 releases are sorted from youngest to oldest.
 
 version :
+- mlp audio decoder
 - DXVA2-accelerated HEVC Main10 decoding
 - fieldhint filter
 - loop video filter and aloop audio filter
diff --git a/configure b/configure
index 9b56a4d..7823e82 100755
--- a/configure
+++ b/configure
@@ -2357,6 +2357,7 @@ mjpeg_decoder_select="blockdsp hpeldsp exif idctdsp jpegtables"
 mjpeg_encoder_select="aandcttables jpegtables mpegvideoenc"
 mjpegb_decoder_select="mjpeg_decoder"
 mlp_decoder_select="mlp_parser"
+mlp_encoder_select="mlp_parser"
 motionpixels_decoder_select="bswapdsp"
 mp1_decoder_select="mpegaudio"
 mp1float_decoder_select="mpegaudio"
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index bbca908..def53f0 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -355,6 +355,7 @@ OBJS-$(CONFIG_MJPEG_DECODER)   += mjpegdec.o
 OBJS-$(CONFIG_MJPEG_ENCODER)   += mjpegenc.o mjpegenc_common.o
 OBJS-$(CONFIG_MJPEGB_DECODER)  += mjpegbdec.o
 OBJS-$(CONFIG_MLP_DECODER) += mlpdec.o mlpdsp.o
+OBJS-$(CONFIG_MLP_ENCODER) += mlpenc.o mlpdsp.o
 OBJS-$(CONFIG_MMVIDEO_DECODER) += mmvideo.o
 OBJS-$(CONFIG_MOTIONPIXELS_DECODER)+= motionpixels.o
 OBJS-$(CONFIG_MOVTEXT_DECODER) += movtextdec.o ass.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 91c1c5c..79b5983 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -413,7 +414,7 @@ void avcodec_register_all(void)
 REGISTER_DECODER(MACE3, mace3);
 REGISTER_DECODER(MACE6, mace6);
 REGISTER_DECODER(METASOUND, metasound);
-REGISTER_DECODER(MLP,   mlp);
+REGISTER_ENCDEC(MLP,   mlp);
 REGISTER_DECODER(MP1,   mp1);
 REGISTER_DECODER(MP1FLOAT,  mp1float);
 REGISTER_ENCDEC (MP2,   mp2);
diff --git a/libavcodec/mlp.h b/libavcodec/mlp.h
index 05d8dba..bc1e2f0 100644
--- a/libavcodec/mlp.h
+++ b/libavcodec/mlp.h
@@ -72,6 +72,10 @@
 
 /** filter data */
 typedef struct FilterParams {
+int coeff[MAX_FIR_ORDER];
+int coeff_bits;
+int coeff_shift;
+
 uint8_t order; ///< number of taps in filter
 uint8_t shift; ///< Right shift to apply to output of filter.
 
diff --git a/libavcodec/mlpenc.c b/libavcodec/mlpenc.c
new file mode 100755
index 000..bfc2850
--- /dev/null
+++ b/libavcodec/mlpenc.c
@@ -0,0 +1,2462 @@
+/**
+ * MLP encoder
+ * Copyright (c) 2008 Ramiro Polla 
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR 

[FFmpeg-devel] Support AS-10 MXF

2016-03-29 Thread NabFab

Hi,
Could you please tell me if ffmpeg is supporting AS-10 or AS-11 MXF 
format according to AMWA specifications ?

Thank you



---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel 
antivirus Avast.
https://www.avast.com/antivirus

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


Re: [FFmpeg-devel] [PATCH] Implement hdcd filtering

2016-03-29 Thread Michael Niedermayer
On Tue, Mar 29, 2016 at 11:30:28AM +0200, Benjamin St wrote:
> > Not all of the comments on top of the filter file look
> > very useful to me, what do you think?
> > In any case, I'd say a link to these should be useful:
> > http://www.audiomisc.co.uk/HFN/HDCD/Enigma.html
> > http://www.audiomisc.co.uk/HFN/HDCD/Examined.html
> > (Or only the second one.)
> >
> I removed the rather useless comment and added both links.
> 
> Please also add a fate test, since this is using floats,
> > I would suggest to only compare pcm_s16 (instead of 24).
> 
> Floats are no longer needed. This version uses only integer.

>  Makefile |1 
>  af_hdcd.c| 1138 
> +++
>  allfilters.c |1 
>  3 files changed, 1140 insertions(+)
> 4e25a0315a659eb9e71adfacb9f9b2e78c5e1f33  
> 0001-Implement-high-definition-audio-cd-filtering.patch
> From f3053beac96884123e1c9d50b46876e6f69ae0d1 Mon Sep 17 00:00:00 2001
> From: Benjamin Steffes 
> Date: Mon, 21 Mar 2016 23:52:48 +0100
> Subject: [PATCH] Implement high definition audio cd filtering.
> 
> Signed-off-by: Benjamin Steffes 
> ---
>  libavfilter/Makefile |1 +
>  libavfilter/af_hdcd.c| 1138 
> ++
>  libavfilter/allfilters.c |1 +
>  3 files changed, 1140 insertions(+)
>  create mode 100644 libavfilter/af_hdcd.c

fails make fate

--- ./tests/ref/fate/source 2016-03-28 20:55:31.220829289 +0200
+++ tests/data/fate/source  2016-03-29 23:51:43.338872226 +0200
@@ -8,6 +8,7 @@
 libavcodec/mathops.c
 libavcodec/reverse.c
 libavdevice/file_open.c
+libavfilter/af_hdcd.c
 libavfilter/log2_tab.c
 libavformat/file_open.c
 libavformat/golomb_tab.c
Test source failed. Look at tests/data/fate/source.err for details.
make: *** [fate-source] Error 1
make: *** Waiting for unfinished jobs

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

it is not once nor twice but times without number that the same ideas make
their appearance in the world. -- Aristotle


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavu/base64: add AV_BASE64_DECODE_SIZE() macro

2016-03-29 Thread Michael Niedermayer
On Tue, Mar 29, 2016 at 12:39:23PM +0200, Stefano Sabatini wrote:
> This is consistent with the AV_BASE64_SIZE macro and avoids the literal
> use of constants in the code.
> 
> TODO: update APIchanges and bump minor.
> ---
>  libavutil/base64.h | 9 +++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/libavutil/base64.h b/libavutil/base64.h
> index 514498e..e8a6e41 100644
> --- a/libavutil/base64.h
> +++ b/libavutil/base64.h
> @@ -29,20 +29,25 @@
>   * @{
>   */
>  
> -
>  /**
>   * Decode a base64-encoded string.
>   *
>   * @param out  buffer for decoded data
>   * @param in   null-terminated input string
>   * @param out_size size in bytes of the out buffer, must be at
> - * least 3/4 of the length of in
> + * least 3/4 of the length of in, that is 
> AV_BASE64_DECODE_SIZE(strlen(in))
>   * @return number of bytes written, or a negative value in case of
>   * invalid input
>   */
>  int av_base64_decode(uint8_t *out, const char *in, int out_size);
>  
>  /**
> + * Calculate the output size in bytes needed to decode a base64 string
> + * with lenght x to a data buffer.
> + */
> +#define AV_BASE64_DECODE_SIZE(x) ((x) * 3 / 4)

3LL otherwise it could overflow

LGTM

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Concerning the gods, I have no means of knowing whether they exist or not
or of what sort they may be, because of the obscurity of the subject, and
the brevity of human life -- Protagoras


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 3/6] lavc/audiotoolboxenc: fix iOS build

2016-03-29 Thread Rodger Combs

> On Mar 27, 2016, at 21:13, crossle song  wrote:
> 
> Work well on iPhone 6, but on  iPhone 4S iOS 9.0, return  [aac_at @
> 0x1702a400] Encode error: -50, can not work

I don't have a test setup for iOS devices (nor a 4S to test on); does this case 
work correctly with your patch, but not mine? What's the full ffmpeg command 
you're using to test? (Or is this using lavc in another application?)
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] mpegts: pcr period option for variable bitrate multiplexing

2016-03-29 Thread Predrag Filipovic
Regarding "pcr is different but once the value is correct, mechanism is the
same ... pat/sdt"
Correct. These are (pcr vs other) or can be identical for CBR. Identical
(mechanisms) is OK
for VBR (as a matter of principle) but one could also have simpler
implementation
for pat/sdt since their lower bound is flexible (and no need to constantly
check pcr value).

In general, I will do per you suggestions (as soon as I get some "breathing
space" ...)

Regards,

Predrag Filipovic

On Mon, Mar 28, 2016 at 9:23 PM, Michael Niedermayer  wrote:

> On Mon, Mar 28, 2016 at 07:58:29PM -0400, Predrag Filipovic wrote:
> > Inline answers and some questions/advice_sought are marked by "---"
> (start
> > and end)
> >
> > Couple of NOTES and a bit more:
> >
> > NOTE 1:
> > PCR is a different "animal" from PCR/PAT/PMT/SDT (PSI's): PSI have upper
> > bound
> > deadline with no consequences if inserted early while PCR value needs to
> > reflect
> > time at the "time" of insertion, and precisely so if system is to avoid
> > violating T-STD model.
>
> please correct me if iam wrong but
> pcr is different but when the value stored is correct for the
> point where it is stored then its basically the same.
>
>
> [...]
> > This was paid effort for specific issue. I do plan to proceed with proper
> > design (I hope
> > paid effort but if not, once I get some time ... May onwards, after NAB
> > ...).
>
> that would be great
>
>
> >
> > I'll split patches per your suggestions and also include other
> recommended
> > changes
> > (see inline).
>
> please do
> more comments below inline
>
>
> >
> > Regards
> >
> > Predrag Filipovic
> >
> > On Sun, Mar 27, 2016 at 8:09 AM, Michael Niedermayer
>  > > wrote:
> >
> > > On Fri, Mar 25, 2016 at 12:50:29PM -0400, Predrag Filipovic wrote:
> > > > Enable proper PCR insertion for VBR multiplexing (muxrate not
> specified).
> > > > Insertion timing is based on video frame keys and frame period,
> > > consequently
> > > > pcr period precision is limited to +/- one video frame period.
> > > >
> > > > Signed-off-by: Predrag Filipovic 
> > > > ---
> > > >  libavformat/mpegtsenc.c | 80
> > > +
> > > >  1 file changed, 61 insertions(+), 19 deletions(-)
> > > >
> > > > diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
> > > > index 7656720..7ed9076 100644
> > > > --- a/libavformat/mpegtsenc.c
> > > > +++ b/libavformat/mpegtsenc.c
> > > > @@ -105,6 +105,7 @@ typedef struct MpegTSWrite {
> > > >  int tables_version;
> > > >  double pat_period;
> > > >  double sdt_period;
> > > > +int64_t last_pcr_ts;
> > > >  int64_t last_pat_ts;
> > > >  int64_t last_sdt_ts;
> > > >
> > > > @@ -903,6 +904,9 @@ static int mpegts_init(AVFormatContext *s)
> > > >  ts_st = pcr_st->priv_data;
> > > >
> > > >  if (ts->mux_rate > 1) {
> > > > +if (ts->pcr_period >= INT_MAX/2) {
> > > > +ts->pcr_period = PCR_RETRANS_TIME;
> > > > +}
> > >
> > > Currently pcr_period defaults are handled differently from
> > > pat_period and sdt_period
> > > after this patch its still different, why ?
> > >
> > > ts->sdt_packet_period and ts->pat_packet_period are initiaized to
> > > defaults, and disabled later in case of user provided parameters
> > >
> > > for pcr_period the user provided value is overridden (this is a bit
> > > ugly IMHO) and pcr_packet_period set to the user provided value if any
> > > and later only conditionally overriden in the VBR case
> > >
> > > why do you not change pcr_packet_period / pcr_period to work like
> > > pat_period & sdt_period ?
> > >
> > ---
> > See NOTE 1, 3 at the start of Email
> > PCR override follows the same concept as overrides for pat and sdt, it
> was
> > just placed "hire up" where CBR and VBR cases are already split.
> > Yes, its ugly, should I move it down (same cluster as pat, sdt ?
> > ---
>
> if you can make it more similar to the pat/sdt case then please do
>
>
> >
> > >
> > > >  service->pcr_packet_period = (int64_t)ts->mux_rate *
> > > ts->pcr_period /
> > > >   (TS_PACKET_SIZE * 8 * 1000);
> > > >  ts->sdt_packet_period  = (int64_t)ts->mux_rate *
> > > SDT_RETRANS_TIME /
> > > > @@ -931,10 +935,19 @@ static int mpegts_init(AVFormatContext *s)
> > > >  service->pcr_packet_period =
> > > >  ts_st->user_tb.den / (10 * ts_st->user_tb.num);
> > > >  }
> > > > -if (!service->pcr_packet_period)
> > > > +/* if pcr_period specified, mark pcr_packet_period as NA
> > > (=INT_MAX) */
> > > > +if (ts->pcr_period < INT_MAX/2) {
> > > > +service->pcr_packet_period = INT_MAX;
> > > > +} else {
> > > > +if (!service->pcr_packet_period) {
> > > >  service->pcr_packet_period = 1;
> > > > +} else if (service->pcr_packet_period == INT_MAX) {
> > > > +   

Re: [FFmpeg-devel] [RFC]lavf/mpegtsenc: Allow DVB stream_type for mp2 audio

2016-03-29 Thread Moritz Barsnick
On Tue, Mar 29, 2016 at 21:09:07 +0200, Carl Eugen Hoyos wrote:
> Afaict, this is not what was requested in the ticket though.

Pretty much so, except if you want to interpret different things into
"broadcasting standards".

From an ITU-T H.222.0 standpoint, your patch at least correctly fixes
*something*, even if that wasn't what the reporter requested.

(I didn't look into the difference between ATSC and System B though.
Actually, from my search results I get the impression a difference
between System A and System B applies only to AC3. IANA MPEG-TS expert
at all.)

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


[FFmpeg-devel] [PATCH v3 3/3] Tee muxer improvement (handling slave failure)

2016-03-29 Thread sebechlebskyjan
From: Jan Sebechlebsky 

Adds per slave option 'onfail' to the tee muxer allowing an output to
fail,so other slave outputs can continue.

Signed-off-by: Jan Sebechlebsky 
---
 doc/muxers.texi   | 14 
 libavformat/tee.c | 96 +--
 2 files changed, 100 insertions(+), 10 deletions(-)

diff --git a/doc/muxers.texi b/doc/muxers.texi
index c36c72c..5a40c31 100644
--- a/doc/muxers.texi
+++ b/doc/muxers.texi
@@ -1367,6 +1367,12 @@ Select the streams that should be mapped to the slave 
output,
 specified by a stream specifier. If not specified, this defaults to
 all the input streams. You may use multiple stream specifiers
 separated by commas (@code{,}) e.g.: @code{a:0,v}
+
+@item onfail
+Specify behaviour on output failure. This can be set to either @code{abort} 
(which is
+default) or @code{ignore}. @code{abort} will cause whole process to fail in 
case of failure
+on this slave output. @code{ignore} will ignore failure on this output, so 
other outputs
+will continue without being affected.
 @end table
 
 @subsection Examples
@@ -1381,6 +1387,14 @@ ffmpeg -i ... -c:v libx264 -c:a mp2 -f tee -map 0:v -map 
0:a
 @end example
 
 @item
+As above, but continue streaming even if output to local file fails
+(for example local drive fills up):
+@example
+ffmpeg -i ... -c:v libx264 -c:a mp2 -f tee -map 0:v -map 0:a
+  "[onfail=ignore]archive-20121107.mkv|[f=mpegts]udp://10.0.1.255:1234/"
+@end example
+
+@item
 Use @command{ffmpeg} to encode the input, and send the output
 to three different destinations. The @code{dump_extra} bitstream
 filter is used to add extradata information to all the output video
diff --git a/libavformat/tee.c b/libavformat/tee.c
index dfa5f46..3b0bada 100644
--- a/libavformat/tee.c
+++ b/libavformat/tee.c
@@ -29,10 +29,20 @@
 
 #define MAX_SLAVES 16
 
+typedef enum {
+ON_SLAVE_FAILURE_ABORT  = 1,
+ON_SLAVE_FAILURE_IGNORE = 2
+} SlaveFailurePolicy;
+
+#define DEFAULT_SLAVE_FAILURE_POLICY ON_SLAVE_FAILURE_ABORT
+
 typedef struct {
 AVFormatContext *avf;
 AVBitStreamFilterContext **bsfs; ///< bitstream filters per stream
 
+SlaveFailurePolicy on_fail;
+unsigned char is_alive;
+
 /** map from input to output streams indexes,
  * disabled output streams are set to -1 */
 int *stream_map;
@@ -41,6 +51,7 @@ typedef struct {
 typedef struct TeeContext {
 const AVClass *class;
 unsigned nb_slaves;
+unsigned nb_alive;
 TeeSlave slaves[MAX_SLAVES];
 } TeeContext;
 
@@ -135,6 +146,18 @@ end:
 return ret;
 }
 
+static inline int parse_slave_failure_policy_option(const char *opt)
+{
+if (!opt) {
+return DEFAULT_SLAVE_FAILURE_POLICY;
+} else if (!av_strcasecmp("abort", opt)) {
+return ON_SLAVE_FAILURE_ABORT;
+} else if (!av_strcasecmp("ignore", opt)) {
+return ON_SLAVE_FAILURE_IGNORE;
+}
+return 0;
+}
+
 static void close_slave(TeeSlave *tee_slave)
 {
 AVFormatContext *avf;
@@ -165,7 +188,8 @@ static void close_slaves(AVFormatContext *avf)
 unsigned i;
 
 for (i = 0; i < tee->nb_slaves; i++) {
-close_slave(>slaves[i]);
+if (tee->slaves[i].is_alive)
+close_slave(>slaves[i]);
 }
 }
 
@@ -175,7 +199,7 @@ static int open_slave(AVFormatContext *avf, char *slave, 
TeeSlave *tee_slave)
 AVDictionary *options = NULL;
 AVDictionaryEntry *entry;
 char *filename;
-char *format = NULL, *select = NULL;
+char *format = NULL, *select = NULL, *on_fail = NULL;
 AVFormatContext *avf2 = NULL;
 AVStream *st, *st2;
 int stream_count;
@@ -195,6 +219,17 @@ static int open_slave(AVFormatContext *avf, char *slave, 
TeeSlave *tee_slave)
 
 STEAL_OPTION("f", format);
 STEAL_OPTION("select", select);
+STEAL_OPTION("onfail", on_fail);
+
+tee_slave->on_fail = parse_slave_failure_policy_option(on_fail);
+if (!tee_slave->on_fail) {
+av_log(avf, AV_LOG_ERROR,
+   "Invalid onfail option value, valid options are 'abort' and 
'ignore'\n");
+ret = AVERROR(EINVAL);
+/* Set failure behaviour to abort, so invalid option error will not be 
ignored */
+tee_slave->on_fail = ON_SLAVE_FAILURE_ABORT;
+goto end;
+}
 
 ret = avformat_alloc_output_context2(, NULL, format, filename);
 if (ret < 0)
@@ -339,8 +374,11 @@ static int open_slave(AVFormatContext *avf, char *slave, 
TeeSlave *tee_slave)
 }
 
 end:
+if (ret < 0)
+close_slave(tee_slave);
 av_free(format);
 av_free(select);
+av_free(on_fail);
 av_dict_free();
 av_freep(_select);
 return ret;
@@ -370,6 +408,31 @@ static void log_slave(TeeSlave *slave, void *log_ctx, int 
log_level)
 }
 }
 
+static int tee_process_slave_failure(AVFormatContext *avf, unsigned slave_idx,
+ int err_n, unsigned char needs_closing)
+{
+TeeContext *tee = avf->priv_data;
+

Re: [FFmpeg-devel] [RFC]lavf/mpegtsenc: Allow DVB stream_type for mp2 audio

2016-03-29 Thread Carl Eugen Hoyos
On Tuesday 29 March 2016 05:37:02 pm Kieran Kunhya wrote:
> On Tue, 29 Mar 2016 at 15:32 Carl Eugen Hoyos wrote:
> >
> > Could attached maybe fix ticket #5388?
>
> The correct solution is to give "MP2" the MP1 stream_type and 
> "MP3" the MP2 stream_type.

As in attached?

Afaict, this is not what was requested in the ticket though.

Carl Eugen
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index 51677ea..6a623eb 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -317,9 +317,11 @@ static int mpegts_write_pmt(AVFormatContext *s, 
MpegTSService *service)
 stream_type = STREAM_TYPE_VIDEO_VC1;
 break;
 case AV_CODEC_ID_MP2:
-case AV_CODEC_ID_MP3:
 stream_type = STREAM_TYPE_AUDIO_MPEG1;
 break;
+case AV_CODEC_ID_MP3:
+stream_type = STREAM_TYPE_AUDIO_MPEG2;
+break;
 case AV_CODEC_ID_AAC:
 stream_type = (ts->flags & MPEGTS_FLAG_AAC_LATM)
   ? STREAM_TYPE_AUDIO_AAC_LATM
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v2 3/3] Tee muxer improvement (handling slave failure)

2016-03-29 Thread Jan Sebechlebsky

On 03/29/2016 09:01 PM, Nicolas George wrote:

Le decadi 10 germinal, an CCXXIV, Nicolas George a écrit :

Le decadi 10 germinal, an CCXXIV, Jan Sebechlebsky a écrit :

+@item onfail
+Specify behaviour on output failure. This can be set to either 'abort' (which 
is

I believe @code{...} is recommended for explicit words.

Line containing @code{...} is not added by patch (Fix of documentation
should be probably separate commit).

The patch adds lines containing "'something'", and I was suggesting that it
should have been "@code{something}".

... and please remember to send your mail to the mailing-list, not
privately.

Regards,



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

Sorry for that, I'll change it.

Jan S.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v2 3/3] Tee muxer improvement (handling slave failure)

2016-03-29 Thread Nicolas George
Le decadi 10 germinal, an CCXXIV, Nicolas George a écrit :
> Le decadi 10 germinal, an CCXXIV, Jan Sebechlebsky a écrit :
> > >>+@item onfail
> > >>+Specify behaviour on output failure. This can be set to either 'abort' 
> > >>(which is
> > >I believe @code{...} is recommended for explicit words.
> > Line containing @code{...} is not added by patch (Fix of documentation
> > should be probably separate commit).
> 
> The patch adds lines containing "'something'", and I was suggesting that it
> should have been "@code{something}".

... and please remember to send your mail to the mailing-list, not
privately.

Regards,

-- 
  Nicolas George


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] Fwd: [Build #9405537] armhf build of ffmpeg 7:3.1~~git20160327.62458~ubuntu14.04.1 in ubuntu trusty RELEASE [~motumedia/ubuntu/ffmpeg-daily]

2016-03-29 Thread Reinhard Tartler
Hi,

Since a couple of days, the daily builds of FFmpeg on armhf appear to fail on
armhf (but not on other archtectures). The relevant part of the build log
appears to be this:


Test checkasm failed. Look at tests/data/fate/checkasm.err for details.
checkasm: using random seed 3250260437
Bus error (core dumped)
make[2]: *** [fate-checkasm] Error 135


Unfortunately, I do not have access to an armhf system, nor access to the build
directory to check tests/data/fate/checkasm.err myself. Can anyone that has an
armhf system at hand reproduce this? should be as easy as a "make fate-checkasm"
on a ffmpeg git master checkout from 20160327.

Thanks,
-rt

 Forwarded Message 
Subject: [Build #9405537] armhf build of ffmpeg
7:3.1~~git20160327.62458~ubuntu14.04.1 in ubuntu trusty RELEASE
[~motumedia/ubuntu/ffmpeg-daily]
Date: Sun, 27 Mar 2016 13:20:39 -
From: Launchpad Buildd System 
Reply-To: Launchpad Buildd System 
To: Mplayer Build Bot 


 * Source Package: ffmpeg
 * Version: 7:3.1~~git20160327.62458~ubuntu14.04.1
 * Architecture: armhf
 * Archive: ~motumedia/ubuntu/ffmpeg-daily
 * Component: main
 * State: Failed to build
 * Duration: 31 minutes
 * Build Log:
https://launchpad.net/~motumedia/+archive/ubuntu/ffmpeg-daily/+build/9405537/+files/buildlog_ubuntu-trusty-armhf.ffmpeg_7%3A3.1~~git20160327.62458~ubuntu14.04.1_BUILDING.txt.gz
 * Builder: https://launchpad.net/builders/bos01-arm64-035
 * Source: not available



If you want further information about this situation, feel free to
contact a member of the Launchpad Buildd Administrators team.

-- 
armhf build of ffmpeg 7:3.1~~git20160327.62458~ubuntu14.04.1 in ubuntu trusty
RELEASE
https://launchpad.net/~motumedia/+archive/ubuntu/ffmpeg-daily/+build/9405537

You are receiving this email because your team MOTU Media Team is the
owner of this archive.



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


Re: [FFmpeg-devel] [RFC]lavf/mpegtsenc: Allow DVB stream_type for mp2 audio

2016-03-29 Thread Kieran Kunhya
On Tue, 29 Mar 2016 at 15:32 Carl Eugen Hoyos  wrote:

> Hi!
>
> Could attached maybe fix ticket #5388?
>
> Carl Eugen
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


The correct solution is to give "MP2" the MP1 stream_type and "MP3" the MP2
stream_type.

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


Re: [FFmpeg-devel] [PATCH] avcodec/mips: Optimization synced to the newest code base.

2016-03-29 Thread Michael Niedermayer
On Tue, Mar 29, 2016 at 12:51:23PM +, Nedeljko Babic wrote:
> LGTM

applied

thanks

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Dictatorship: All citizens are under surveillance, all their steps and
actions recorded, for the politicians to enforce control.
Democracy: All politicians are under surveillance, all their steps and
actions recorded, for the citizens to enforce control.


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v3 1/3] Refactor close_slaves function in tee muxer

2016-03-29 Thread sebechlebskyjan
From: Jan Sebechlebsky 

Closing single slave operation is pulled out into separate
function close_slave(TeeSlave*).
Both close_slave and close_slaves function are moved before
open_slave function.

Signed-off-by: Jan Sebechlebsky 
---
I've missed bad spacing in close_slave argument in previous version of patch,
this should be all right.

 libavformat/tee.c | 58 ++-
 1 file changed, 32 insertions(+), 26 deletions(-)

diff --git a/libavformat/tee.c b/libavformat/tee.c
index 1390705..bb043fe 100644
--- a/libavformat/tee.c
+++ b/libavformat/tee.c
@@ -135,6 +135,38 @@ end:
 return ret;
 }
 
+static void close_slave(TeeSlave *tee_slave)
+{
+AVFormatContext *avf;
+unsigned i;
+
+avf = tee_slave->avf;
+for (i=0; i < avf->nb_streams; ++i) {
+AVBitStreamFilterContext *bsf_next, *bsf = tee_slave->bsfs[i];
+while (bsf) {
+bsf_next = bsf->next;
+av_bitstream_filter_close(bsf);
+bsf = bsf_next;
+}
+}
+av_freep(_slave->stream_map);
+av_freep(_slave->bsfs);
+
+ff_format_io_close(avf,>pb);
+avformat_free_context(avf);
+tee_slave->avf = NULL;
+}
+
+static void close_slaves(AVFormatContext *avf)
+{
+TeeContext *tee = avf->priv_data;
+unsigned i;
+
+for (i = 0; i < tee->nb_slaves; i++) {
+close_slave(>slaves[i]);
+}
+}
+
 static int open_slave(AVFormatContext *avf, char *slave, TeeSlave *tee_slave)
 {
 int i, ret;
@@ -311,32 +343,6 @@ end:
 return ret;
 }
 
-static void close_slaves(AVFormatContext *avf)
-{
-TeeContext *tee = avf->priv_data;
-AVFormatContext *avf2;
-unsigned i, j;
-
-for (i = 0; i < tee->nb_slaves; i++) {
-avf2 = tee->slaves[i].avf;
-
-for (j = 0; j < avf2->nb_streams; j++) {
-AVBitStreamFilterContext *bsf_next, *bsf = tee->slaves[i].bsfs[j];
-while (bsf) {
-bsf_next = bsf->next;
-av_bitstream_filter_close(bsf);
-bsf = bsf_next;
-}
-}
-av_freep(>slaves[i].stream_map);
-av_freep(>slaves[i].bsfs);
-
-ff_format_io_close(avf2, >pb);
-avformat_free_context(avf2);
-tee->slaves[i].avf = NULL;
-}
-}
-
 static void log_slave(TeeSlave *slave, void *log_ctx, int log_level)
 {
 int i;
-- 
1.9.1

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


[FFmpeg-devel] [RFC]lavf/mpegtsenc: Allow DVB stream_type for mp2 audio

2016-03-29 Thread Carl Eugen Hoyos
Hi!

Could attached maybe fix ticket #5388?

Carl Eugen
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index 51677ea..e226cfa 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -318,7 +318,9 @@ static int mpegts_write_pmt(AVFormatContext *s, 
MpegTSService *service)
 break;
 case AV_CODEC_ID_MP2:
 case AV_CODEC_ID_MP3:
-stream_type = STREAM_TYPE_AUDIO_MPEG1;
+stream_type = (ts->flags & MPEGTS_FLAG_SYSTEM_B)
+  ? STREAM_TYPE_AUDIO_MPEG2
+  : STREAM_TYPE_AUDIO_MPEG1;
 break;
 case AV_CODEC_ID_AAC:
 stream_type = (ts->flags & MPEGTS_FLAG_AAC_LATM)
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v3 2/3] Fix leak and crash in tee muxer when open_slave fails

2016-03-29 Thread sebechlebskyjan
From: Jan Sebechlebsky 

Calling close_slave in case error is to be returned from open_slave
will free allocated resources.

Since failure can happen before bsfs array is initialized,
close_slave must check that bsfs is not NULL before accessing
tee_slave->bsfs[i] element.

Signed-off-by: Jan Sebechlebsky 
---
 libavformat/tee.c | 19 +++
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/libavformat/tee.c b/libavformat/tee.c
index 50c81c4..f5dc443 100644
--- a/libavformat/tee.c
+++ b/libavformat/tee.c
@@ -141,12 +141,14 @@ static void close_slave(TeeSlave* tee_slave)
 unsigned i;
 
 avf = tee_slave->avf;
-for (i=0; i < avf->nb_streams; ++i) {
-AVBitStreamFilterContext *bsf_next, *bsf = tee_slave->bsfs[i];
-while (bsf) {
-bsf_next = bsf->next;
-av_bitstream_filter_close(bsf);
-bsf = bsf_next;
+if (tee_slave->bsfs) {
+for (i=0; i < avf->nb_streams; ++i) {
+AVBitStreamFilterContext *bsf_next, *bsf = tee_slave->bsfs[i];
+while (bsf) {
+bsf_next = bsf->next;
+av_bitstream_filter_close(bsf);
+bsf = bsf_next;
+}
 }
 }
 av_freep(_slave->stream_map);
@@ -197,6 +199,7 @@ static int open_slave(AVFormatContext *avf, char *slave, 
TeeSlave *tee_slave)
 ret = avformat_alloc_output_context2(, NULL, format, filename);
 if (ret < 0)
 goto end;
+tee_slave->avf = avf2;
 av_dict_copy(>metadata, avf->metadata, 0);
 avf2->opaque   = avf->opaque;
 avf2->io_open  = avf->io_open;
@@ -276,7 +279,6 @@ static int open_slave(AVFormatContext *avf, char *slave, 
TeeSlave *tee_slave)
 goto end;
 }
 
-tee_slave->avf = avf2;
 tee_slave->bsfs = av_calloc(avf2->nb_streams, sizeof(TeeSlave));
 if (!tee_slave->bsfs) {
 ret = AVERROR(ENOMEM);
@@ -291,7 +293,8 @@ static int open_slave(AVFormatContext *avf, char *slave, 
TeeSlave *tee_slave)
 av_log(avf, AV_LOG_ERROR,
"Specifier separator in '%s' is '%c', but only 
characters '%s' "
"are allowed\n", entry->key, *spec, 
slave_bsfs_spec_sep);
-return AVERROR(EINVAL);
+ret = AVERROR(EINVAL);
+goto end;
 }
 spec++; /* consume separator */
 }
-- 
1.9.1

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


Re: [FFmpeg-devel] [PATCH v2 2/3] Fix leaks in tee muxer when open_slave fails

2016-03-29 Thread Jan Sebechlebsky



On 03/24/2016 09:51 PM, Marton Balint wrote:


On Thu, 24 Mar 2016, Jan Sebechlebsky wrote:


Calling close_slave in case error is to be returned from open_slave
will free allocated resources.

Since failure can happen before bsfs array is initialized,
close_slave must check that bsfs is not NULL before accessing
tee_slave->bsfs[i] element.

Signed-off-by: Jan Sebechlebsky 
---
libavformat/tee.c | 22 ++
1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/libavformat/tee.c b/libavformat/tee.c
index 09551b3..e43ef08 100644
--- a/libavformat/tee.c
+++ b/libavformat/tee.c
@@ -141,12 +141,14 @@ static void close_slave(TeeSlave* tee_slave)
unsigned i;

avf = tee_slave->avf;
-for (i=0; i < avf->nb_streams; ++i) {
-AVBitStreamFilterContext *bsf_next, *bsf = tee_slave->bsfs[i];
-while (bsf) {
-bsf_next = bsf->next;
-av_bitstream_filter_close(bsf);
-bsf = bsf_next;
+if (tee_slave->bsfs) {
+for (i=0; i < avf->nb_streams; ++i) {
+AVBitStreamFilterContext *bsf_next, *bsf = 
tee_slave->bsfs[i];

+while (bsf) {
+bsf_next = bsf->next;
+av_bitstream_filter_close(bsf);
+bsf = bsf_next;
+}
}
}
av_freep(_slave->stream_map);
@@ -198,6 +200,7 @@ static int open_slave(AVFormatContext *avf, char 
*slave, TeeSlave *tee_slave)

ret = avformat_alloc_output_context2(, NULL, format, filename);
if (ret < 0)
goto end;
+tee_slave->avf = avf2;
av_dict_copy(>metadata, avf->metadata, 0);
avf2->opaque   = avf->opaque;
avf2->io_open  = avf->io_open;
@@ -277,7 +280,6 @@ static int open_slave(AVFormatContext *avf, char 
*slave, TeeSlave *tee_slave)

goto end;
}

-tee_slave->avf = avf2;
tee_slave->bsfs = av_calloc(avf2->nb_streams, sizeof(TeeSlave));
if (!tee_slave->bsfs) {
ret = AVERROR(ENOMEM);
@@ -292,7 +294,8 @@ static int open_slave(AVFormatContext *avf, char 
*slave, TeeSlave *tee_slave)

av_log(avf, AV_LOG_ERROR,
   "Specifier separator in '%s' is '%c', but only 
characters '%s' "
   "are allowed\n", entry->key, *spec, 
slave_bsfs_spec_sep);

-return AVERROR(EINVAL);
+ret = AVERROR(EINVAL);
+goto end;
}
spec++; /* consume separator */
}
@@ -337,6 +340,9 @@ static int open_slave(AVFormatContext *avf, char 
*slave, TeeSlave *tee_slave)

}

end:
+if ( ret < 0 ){
+close_slave(tee_slave);
+}


Do you really need to call close_slave here? As far as I see if 
open_slave fails then the failure path of tee_write_header will call 
close_slaves, so the streams will be closed, therefore no need to do 
it here.
You're right, actually at this point I don't need to call close_slave 
here. But it will be needed in the next commit, since close_slaves 
function skips already dead slaves and then in case of failure of a 
slave which is allowed to fail, this one would not be freed.


I'll move this to the next commit to have consistent changes in each one.


Regards,
Marton
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Have a nice day
Jan

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


[FFmpeg-devel] [PATCH v3 1/3] Refactor close_slaves function in tee muxer

2016-03-29 Thread sebechlebskyjan
From: Jan Sebechlebsky 

Closing single slave operation is pulled out into separate
function close_slave(TeeSlave*).
Both close_slave and close_slaves function are moved before
open_slave function.

Signed-off-by: Jan Sebechlebsky 
---
 libavformat/tee.c | 58 ++-
 1 file changed, 32 insertions(+), 26 deletions(-)

diff --git a/libavformat/tee.c b/libavformat/tee.c
index 1390705..50c81c4 100644
--- a/libavformat/tee.c
+++ b/libavformat/tee.c
@@ -135,6 +135,38 @@ end:
 return ret;
 }
 
+static void close_slave(TeeSlave* tee_slave)
+{
+AVFormatContext *avf;
+unsigned i;
+
+avf = tee_slave->avf;
+for (i=0; i < avf->nb_streams; ++i) {
+AVBitStreamFilterContext *bsf_next, *bsf = tee_slave->bsfs[i];
+while (bsf) {
+bsf_next = bsf->next;
+av_bitstream_filter_close(bsf);
+bsf = bsf_next;
+}
+}
+av_freep(_slave->stream_map);
+av_freep(_slave->bsfs);
+
+ff_format_io_close(avf,>pb);
+avformat_free_context(avf);
+tee_slave->avf = NULL;
+}
+
+static void close_slaves(AVFormatContext *avf)
+{
+TeeContext *tee = avf->priv_data;
+unsigned i;
+
+for (i = 0; i < tee->nb_slaves; i++) {
+close_slave(>slaves[i]);
+}
+}
+
 static int open_slave(AVFormatContext *avf, char *slave, TeeSlave *tee_slave)
 {
 int i, ret;
@@ -311,32 +343,6 @@ end:
 return ret;
 }
 
-static void close_slaves(AVFormatContext *avf)
-{
-TeeContext *tee = avf->priv_data;
-AVFormatContext *avf2;
-unsigned i, j;
-
-for (i = 0; i < tee->nb_slaves; i++) {
-avf2 = tee->slaves[i].avf;
-
-for (j = 0; j < avf2->nb_streams; j++) {
-AVBitStreamFilterContext *bsf_next, *bsf = tee->slaves[i].bsfs[j];
-while (bsf) {
-bsf_next = bsf->next;
-av_bitstream_filter_close(bsf);
-bsf = bsf_next;
-}
-}
-av_freep(>slaves[i].stream_map);
-av_freep(>slaves[i].bsfs);
-
-ff_format_io_close(avf2, >pb);
-avformat_free_context(avf2);
-tee->slaves[i].avf = NULL;
-}
-}
-
 static void log_slave(TeeSlave *slave, void *log_ctx, int log_level)
 {
 int i;
-- 
1.9.1

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


Re: [FFmpeg-devel] [PATCH] avcodec/mips: Optimization synced to the newest code base.

2016-03-29 Thread Nedeljko Babic
LGTM

- Nedeljko

Od: Jovan Zelincevic
Poslato: 29. mart 2016 9:43
Za: ffmpeg-devel@ffmpeg.org
Cc: Zeljko Lukac; Nedeljko Babic; Jovan Zelincevic
Tema: [PATCH] avcodec/mips: Optimization synced to the newest code base.

FFT expanded to 2^17.

Signed-off-by: Jovan Zelincevic 
---
 libavcodec/mips/fft_mips.c | 11 ---
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/libavcodec/mips/fft_mips.c b/libavcodec/mips/fft_mips.c
index 529e076..03dcbad 100644
--- a/libavcodec/mips/fft_mips.c
+++ b/libavcodec/mips/fft_mips.c
@@ -72,7 +72,7 @@ static void ff_fft_calc_mips(FFTContext *s, FFTComplex *z)
 FFTComplex * tmpz_n2, * tmpz_n34, * tmpz_n4;
 FFTComplex * tmpz_n2_i, * tmpz_n34_i, * tmpz_n4_i, * tmpz_i;

-num_transforms = (0x2aab >> (16 - s->nbits)) | 1;
+num_transforms = (21845 >> (17 - s->nbits)) | 1;

 for (n=0; nnbits > 16)
-return;
-
 ff_fft_lut_init(ff_fft_offsets_lut, 0, 1 << 17, );
-ff_init_ff_cos_tabs(16);
+ff_init_ff_cos_tabs(17);

 #if HAVE_INLINE_ASM
 #if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
--
2.7.1

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


Re: [FFmpeg-devel] [PATCH] lavf/matroskadec: Demux the PixelCrop* values

2016-03-29 Thread Dave Rice
Hi,

> On Mar 29, 2016, at 4:23 AM, wm4  wrote:
> 
> On Sat, 26 Mar 2016 16:56:55 -0600
> Nic Wolfe  wrote:
> 
>> The Matroska spec defines PixelCropTop, PixelCropBottom, PixelCropLeft,
>> and PixelCropRight elements: 
>> https://www.matroska.org/technical/specs/index.html
>> 
>> This commit adds support for demuxing these values so that
>> applications using libav*
>> are able to use them when playing the stream. They're added to the AVStream's
>> metadata if they are set to something non-zero.
>> 
>> 
>> My official patch is base64 encoded and attached but I will also
>> include the diff below for (hopefully) convenience.
>> 
> 
> To elaborate on why this change is bad (in its current state):
> 
> - It's not clearly defined what the pixelcrop fields mean. Do they
>  operate before or after aspect rasto is applied? Do they affect
>  aspect ratio calculation? What if aspect ratio or video size change
>  later? Does it get applied after h264 bitstream cropping, does it
>  override it? AFAIK these issues were also discussed on the cellar
>  mailing list, but I didn't follow it.

It was discussed on CELLAR but not patched yet. At the moment, the best 
clarification is from Steve Lhomme in this post 
https://mailarchive.ietf.org/arch/search/?email_list=cellar=display+area+question:
 "Yes, the cropping happens on the pixels, the display size are just how to 
display those remaining pixels.” So the pixelcrop is applied before the aspect 
ratio.

AFAIK there is no determination as to how h264 bitstream cropping and Matroska 
cropping should be prioritized (cc’ing CELLAR on this).

I think the PixelCrop documentation also needs to consider handling in video 
stereo modes.

> - There should generally be a concept at least in libavformat's API how
>  to handle cropping. For example, it could be some sort of well-defined
>  AVStream side data. (Personally I'd be a fan of adding it to AVFrame
>  too. There's no way around if it should work for hw decoding.)
> - Worst of all: it's exported as generic metadata. This means that:
>  - API users could start interpreting the same metadata fields for
>other formats than Matroska too
>  - Transcoders like ffmpeg CLI will copy the crop metadata to other
>containers (as normal metadata).
>  - Non-Matroska files might be created that contain the "made
>up" libavformat Matroska demuxer metadata, and the creator of the
>file expects that programs respect it.
>  (Something like this almost happened with the "old" libavformat
>  rotation metadata, which is also exported as normal metadata.)
> 
> While just adding a "hack" to export metadata for essentially 1 API
> user might be acceptable if adding "proper" API is too hard for now, at
> least the last point needs to be fixed.

I also support a demuxer option to allow pixelcrop to be ignored.
Best Regards,
Dave Rice
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] lavu/base64: add AV_BASE64_DECODE_SIZE() macro

2016-03-29 Thread Stefano Sabatini
This is consistent with the AV_BASE64_SIZE macro and avoids the literal
use of constants in the code.

TODO: update APIchanges and bump minor.
---
 libavutil/base64.h | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/libavutil/base64.h b/libavutil/base64.h
index 514498e..e8a6e41 100644
--- a/libavutil/base64.h
+++ b/libavutil/base64.h
@@ -29,20 +29,25 @@
  * @{
  */
 
-
 /**
  * Decode a base64-encoded string.
  *
  * @param out  buffer for decoded data
  * @param in   null-terminated input string
  * @param out_size size in bytes of the out buffer, must be at
- * least 3/4 of the length of in
+ * least 3/4 of the length of in, that is 
AV_BASE64_DECODE_SIZE(strlen(in))
  * @return number of bytes written, or a negative value in case of
  * invalid input
  */
 int av_base64_decode(uint8_t *out, const char *in, int out_size);
 
 /**
+ * Calculate the output size in bytes needed to decode a base64 string
+ * with lenght x to a data buffer.
+ */
+#define AV_BASE64_DECODE_SIZE(x) ((x) * 3 / 4)
+
+/**
  * Encode data to base64 and null-terminate.
  *
  * @param out  buffer for encoded data
-- 
1.9.1

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


Re: [FFmpeg-devel] [PATCH] lavf/matroskadec: Demux the PixelCrop* values

2016-03-29 Thread wm4
On Sat, 26 Mar 2016 16:56:55 -0600
Nic Wolfe  wrote:

> The Matroska spec defines PixelCropTop, PixelCropBottom, PixelCropLeft,
> and PixelCropRight elements: 
> https://www.matroska.org/technical/specs/index.html
> 
> This commit adds support for demuxing these values so that
> applications using libav*
> are able to use them when playing the stream. They're added to the AVStream's
> metadata if they are set to something non-zero.
> 
> 
> My official patch is base64 encoded and attached but I will also
> include the diff below for (hopefully) convenience.
> 

To elaborate on why this change is bad (in its current state):

- It's not clearly defined what the pixelcrop fields mean. Do they
  operate before or after aspect rasto is applied? Do they affect
  aspect ratio calculation? What if aspect ratio or video size change
  later? Does it get applied after h264 bitstream cropping, does it
  override it? AFAIK these issues were also discussed on the cellar
  mailing list, but I didn't follow it.
- There should generally be a concept at least in libavformat's API how
  to handle cropping. For example, it could be some sort of well-defined
  AVStream side data. (Personally I'd be a fan of adding it to AVFrame
  too. There's no way around if it should work for hw decoding.)
- Worst of all: it's exported as generic metadata. This means that:
  - API users could start interpreting the same metadata fields for
other formats than Matroska too
  - Transcoders like ffmpeg CLI will copy the crop metadata to other
containers (as normal metadata).
  - Non-Matroska files might be created that contain the "made
up" libavformat Matroska demuxer metadata, and the creator of the
file expects that programs respect it.
  (Something like this almost happened with the "old" libavformat
  rotation metadata, which is also exported as normal metadata.)

While just adding a "hack" to export metadata for essentially 1 API
user might be acceptable if adding "proper" API is too hard for now, at
least the last point needs to be fixed.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] avcodec/mips: Optimization synced to the newest code base.

2016-03-29 Thread Jovan Zelincevic
FFT expanded to 2^17.

Signed-off-by: Jovan Zelincevic 
---
 libavcodec/mips/fft_mips.c | 11 ---
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/libavcodec/mips/fft_mips.c b/libavcodec/mips/fft_mips.c
index 529e076..03dcbad 100644
--- a/libavcodec/mips/fft_mips.c
+++ b/libavcodec/mips/fft_mips.c
@@ -72,7 +72,7 @@ static void ff_fft_calc_mips(FFTContext *s, FFTComplex *z)
 FFTComplex * tmpz_n2, * tmpz_n34, * tmpz_n4;
 FFTComplex * tmpz_n2_i, * tmpz_n34_i, * tmpz_n4_i, * tmpz_i;
 
-num_transforms = (0x2aab >> (16 - s->nbits)) | 1;
+num_transforms = (21845 >> (17 - s->nbits)) | 1;
 
 for (n=0; nnbits > 16)
-return;
-
 ff_fft_lut_init(ff_fft_offsets_lut, 0, 1 << 17, );
-ff_init_ff_cos_tabs(16);
+ff_init_ff_cos_tabs(17);
 
 #if HAVE_INLINE_ASM
 #if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
-- 
2.7.1

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


Re: [FFmpeg-devel] [PATCH 2/2] lavf: Add coreimage filter for GPU based image filtering on OSX.

2016-03-29 Thread Matt Oliver
>
> +enabled coreimage_filter  && { check_header_objcc QuartzCore/CoreImage.h
> || disable coreimage_filter; }
> +enabled coreimagesrc_filter && { check_header_objcc
> QuartzCore/CoreImage.h || disable coreimagesrc_filter; }
>

Wouldnt it be simpler to just add an item to HEADERS_LIST for
QuartzCore_CoreImage_h then this check only needs to be done once as both
filters can then just depend on the header list entry.
e.g.
coreimage_filter_deps="QuartzCore_CoreImage_h"
...
check_header_objcc QuartzCore/CoreImage.h

This would also remove the need for the duplicate  _extralibs= lines aswell.

VideoToolbox currently does something like this although much more
complicated as it was added as an external lib despite being in a similar
boat to coreimage.

FYI I noticed what looks like an error in check_header_objcc as the code
"enable_safe $headers" I believe should be "enable_safe $header" (no 's').
I dont have OSX to double check this.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel