Re: [FFmpeg-devel] [PATCH] avcodec: Add bits_per_raw_sample to AVCodecParameters

2016-04-15 Thread Michael Niedermayer
On Fri, Apr 15, 2016 at 12:38:23PM +0200, wm4 wrote:
> On Fri, 15 Apr 2016 00:06:27 -0300
> James Almer  wrote:
> 
> > On 4/14/2016 7:30 PM, Michael Niedermayer wrote:
> > > On Tue, Apr 12, 2016 at 01:25:43PM +0200, wm4 wrote:  
> > >> On Tue, 12 Apr 2016 13:10:09 +0200
> > >> Michael Niedermayer  wrote:
> > >>  
> > >>> On Mon, Apr 11, 2016 at 01:32:07AM +0200, Michael Niedermayer wrote:  
> >  The bits_per_raw_sample represents the number of bits of precission 
> >  per sample.
> > 
> >  The field is added at the logical place, not at the end as the code 
> >  was just
> >  recently added
> > 
> >  This fixes the regression about loosing the audio sample precission 
> >  information
> > 
> >  The change in the fate test checksum un-does the change from the merge
> > 
> >  Signed-off-by: Michael Niedermayer 
> >  ---
> >   libavcodec/avcodec.h |   17 +
> >   libavcodec/utils.c   |2 ++
> >   tests/ref/lavf/ffm   |2 +-
> >   3 files changed, 20 insertions(+), 1 deletion(-)
> > >>>
> > >>> new version of this with improved documentation
> > >>> I intend to apply this soon if noone is against
> > >>>
> > >>>
> > >>> From e500dd31368b760144b1e2b5b094f73b571b Mon Sep 17 00:00:00 2001
> > >>> From: Michael Niedermayer 
> > >>> Date: Mon, 11 Apr 2016 00:52:21 +0200
> > >>> Subject: [PATCH] avcodec: Add bits_per_raw_sample to AVCodecParameters
> > >>>
> > >>> The bits_per_raw_sample represents the number of bits of precission per 
> > >>> sample.
> > >>>
> > >>> The field is added at the logical place, not at the end as the code was 
> > >>> just
> > >>> recently added
> > >>>
> > >>> This fixes the regression about loosing the audio sample precission 
> > >>> information
> > >>>
> > >>> The change in the fate test checksum un-does the change from the merge
> > >>>
> > >>> Signed-off-by: Michael Niedermayer 
> > >>> ---
> > >>>  libavcodec/avcodec.h |   21 +
> > >>>  libavcodec/utils.c   |2 ++
> > >>>  tests/ref/lavf/ffm   |2 +-
> > >>>  3 files changed, 24 insertions(+), 1 deletion(-)
> > >>>
> > >>> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> > >>> index b3655c5..99cbf88 100644
> > >>> --- a/libavcodec/avcodec.h
> > >>> +++ b/libavcodec/avcodec.h
> > >>> @@ -3832,9 +3832,30 @@ typedef struct AVCodecParameters {
> > >>>   */
> > >>>  int64_t bit_rate;
> > >>>
> > >>> +/**
> > >>> + * The number of bits per sample in the codedwords.
> > >>> + *
> > >>> + * This is basically the bitrate per sample, it is mandatory for a 
> > >>> bunch of
> > >>> + * formats to actually decode them, its the number of bits for one 
> > >>> sample in  
> > >>
> > >> "It's". Also, add more full stops instead of creating long sentences.
> > >>  
> > >>> + * the actual coded bitstream.
> > >>> + *
> > >>> + * This could be for example 4 for ADPCM
> > >>> + * For PCM formats this matches bits_per_raw_sample
> > >>> + * Can be 0
> > >>> + */
> > >>>  int bits_per_coded_sample;
> > >>>
> > >>>  /**
> > >>> + * The number of bits of precission in the samples.  
> > >>
> > >> Precision. Just get a spellchecker.
> > >>  
> > >>> + *
> > >>> + * These are the bits in a decoded (raw) sample.  
> > >>
> > >> Maybe: "This is the number of valid bits in each output sample. If the
> > >> sample format has more bits, the least significant bits are additional
> > >> padding bits, which are always 0. Use right shifts to reduce the sample
> > >> to its actual size. For example, audio formats with 24 bit samples will
> > >> have bits_per_raw_sample set to 24, and format set to AV_SAMPLEFMT_S32.
> > >> To get the original sample use "(uint32_t)sample >> 8"."
> > >>
> > >> Don't know if this is good. (Also is it even correct? I forgot whether
> > >> audio sample data uses negative values too.) Maybe this should be added
> > >> to AVCodecContext too. It's a common point of confusion.  
> > > 
> > > suggested changed made ad applied  
> > 
> > Should the change made to matroskaenc be reverted then? It was changed from
> > using bits_per_raw_sample to bits_per_coded_sample in the codecpar commit
> > because the former wasn't available back then.
> > 
> 
> Yep.

change made

i forgot about it totally

thx


[...]
-- 
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


Re: [FFmpeg-devel] [PATCH] avcodec: Add bits_per_raw_sample to AVCodecParameters

2016-04-15 Thread wm4
On Fri, 15 Apr 2016 00:06:27 -0300
James Almer  wrote:

> On 4/14/2016 7:30 PM, Michael Niedermayer wrote:
> > On Tue, Apr 12, 2016 at 01:25:43PM +0200, wm4 wrote:  
> >> On Tue, 12 Apr 2016 13:10:09 +0200
> >> Michael Niedermayer  wrote:
> >>  
> >>> On Mon, Apr 11, 2016 at 01:32:07AM +0200, Michael Niedermayer wrote:  
>  The bits_per_raw_sample represents the number of bits of precission per 
>  sample.
> 
>  The field is added at the logical place, not at the end as the code was 
>  just
>  recently added
> 
>  This fixes the regression about loosing the audio sample precission 
>  information
> 
>  The change in the fate test checksum un-does the change from the merge
> 
>  Signed-off-by: Michael Niedermayer 
>  ---
>   libavcodec/avcodec.h |   17 +
>   libavcodec/utils.c   |2 ++
>   tests/ref/lavf/ffm   |2 +-
>   3 files changed, 20 insertions(+), 1 deletion(-)
> >>>
> >>> new version of this with improved documentation
> >>> I intend to apply this soon if noone is against
> >>>
> >>>
> >>> From e500dd31368b760144b1e2b5b094f73b571b Mon Sep 17 00:00:00 2001
> >>> From: Michael Niedermayer 
> >>> Date: Mon, 11 Apr 2016 00:52:21 +0200
> >>> Subject: [PATCH] avcodec: Add bits_per_raw_sample to AVCodecParameters
> >>>
> >>> The bits_per_raw_sample represents the number of bits of precission per 
> >>> sample.
> >>>
> >>> The field is added at the logical place, not at the end as the code was 
> >>> just
> >>> recently added
> >>>
> >>> This fixes the regression about loosing the audio sample precission 
> >>> information
> >>>
> >>> The change in the fate test checksum un-does the change from the merge
> >>>
> >>> Signed-off-by: Michael Niedermayer 
> >>> ---
> >>>  libavcodec/avcodec.h |   21 +
> >>>  libavcodec/utils.c   |2 ++
> >>>  tests/ref/lavf/ffm   |2 +-
> >>>  3 files changed, 24 insertions(+), 1 deletion(-)
> >>>
> >>> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> >>> index b3655c5..99cbf88 100644
> >>> --- a/libavcodec/avcodec.h
> >>> +++ b/libavcodec/avcodec.h
> >>> @@ -3832,9 +3832,30 @@ typedef struct AVCodecParameters {
> >>>   */
> >>>  int64_t bit_rate;
> >>>
> >>> +/**
> >>> + * The number of bits per sample in the codedwords.
> >>> + *
> >>> + * This is basically the bitrate per sample, it is mandatory for a 
> >>> bunch of
> >>> + * formats to actually decode them, its the number of bits for one 
> >>> sample in  
> >>
> >> "It's". Also, add more full stops instead of creating long sentences.
> >>  
> >>> + * the actual coded bitstream.
> >>> + *
> >>> + * This could be for example 4 for ADPCM
> >>> + * For PCM formats this matches bits_per_raw_sample
> >>> + * Can be 0
> >>> + */
> >>>  int bits_per_coded_sample;
> >>>
> >>>  /**
> >>> + * The number of bits of precission in the samples.  
> >>
> >> Precision. Just get a spellchecker.
> >>  
> >>> + *
> >>> + * These are the bits in a decoded (raw) sample.  
> >>
> >> Maybe: "This is the number of valid bits in each output sample. If the
> >> sample format has more bits, the least significant bits are additional
> >> padding bits, which are always 0. Use right shifts to reduce the sample
> >> to its actual size. For example, audio formats with 24 bit samples will
> >> have bits_per_raw_sample set to 24, and format set to AV_SAMPLEFMT_S32.
> >> To get the original sample use "(uint32_t)sample >> 8"."
> >>
> >> Don't know if this is good. (Also is it even correct? I forgot whether
> >> audio sample data uses negative values too.) Maybe this should be added
> >> to AVCodecContext too. It's a common point of confusion.  
> > 
> > suggested changed made ad applied  
> 
> Should the change made to matroskaenc be reverted then? It was changed from
> using bits_per_raw_sample to bits_per_coded_sample in the codecpar commit
> because the former wasn't available back then.
> 

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


Re: [FFmpeg-devel] [PATCH] avcodec: Add bits_per_raw_sample to AVCodecParameters

2016-04-14 Thread James Almer
On 4/14/2016 7:30 PM, Michael Niedermayer wrote:
> On Tue, Apr 12, 2016 at 01:25:43PM +0200, wm4 wrote:
>> On Tue, 12 Apr 2016 13:10:09 +0200
>> Michael Niedermayer  wrote:
>>
>>> On Mon, Apr 11, 2016 at 01:32:07AM +0200, Michael Niedermayer wrote:
 The bits_per_raw_sample represents the number of bits of precission per 
 sample.

 The field is added at the logical place, not at the end as the code was 
 just
 recently added

 This fixes the regression about loosing the audio sample precission 
 information

 The change in the fate test checksum un-does the change from the merge

 Signed-off-by: Michael Niedermayer 
 ---
  libavcodec/avcodec.h |   17 +
  libavcodec/utils.c   |2 ++
  tests/ref/lavf/ffm   |2 +-
  3 files changed, 20 insertions(+), 1 deletion(-)  
>>>
>>> new version of this with improved documentation
>>> I intend to apply this soon if noone is against
>>>
>>>
>>> From e500dd31368b760144b1e2b5b094f73b571b Mon Sep 17 00:00:00 2001
>>> From: Michael Niedermayer 
>>> Date: Mon, 11 Apr 2016 00:52:21 +0200
>>> Subject: [PATCH] avcodec: Add bits_per_raw_sample to AVCodecParameters
>>>
>>> The bits_per_raw_sample represents the number of bits of precission per 
>>> sample.
>>>
>>> The field is added at the logical place, not at the end as the code was just
>>> recently added
>>>
>>> This fixes the regression about loosing the audio sample precission 
>>> information
>>>
>>> The change in the fate test checksum un-does the change from the merge
>>>
>>> Signed-off-by: Michael Niedermayer 
>>> ---
>>>  libavcodec/avcodec.h |   21 +
>>>  libavcodec/utils.c   |2 ++
>>>  tests/ref/lavf/ffm   |2 +-
>>>  3 files changed, 24 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
>>> index b3655c5..99cbf88 100644
>>> --- a/libavcodec/avcodec.h
>>> +++ b/libavcodec/avcodec.h
>>> @@ -3832,9 +3832,30 @@ typedef struct AVCodecParameters {
>>>   */
>>>  int64_t bit_rate;
>>>
>>> +/**
>>> + * The number of bits per sample in the codedwords.
>>> + *
>>> + * This is basically the bitrate per sample, it is mandatory for a 
>>> bunch of
>>> + * formats to actually decode them, its the number of bits for one 
>>> sample in
>>
>> "It's". Also, add more full stops instead of creating long sentences.
>>
>>> + * the actual coded bitstream.
>>> + *
>>> + * This could be for example 4 for ADPCM
>>> + * For PCM formats this matches bits_per_raw_sample
>>> + * Can be 0
>>> + */
>>>  int bits_per_coded_sample;
>>>
>>>  /**
>>> + * The number of bits of precission in the samples.
>>
>> Precision. Just get a spellchecker.
>>
>>> + *
>>> + * These are the bits in a decoded (raw) sample.
>>
>> Maybe: "This is the number of valid bits in each output sample. If the
>> sample format has more bits, the least significant bits are additional
>> padding bits, which are always 0. Use right shifts to reduce the sample
>> to its actual size. For example, audio formats with 24 bit samples will
>> have bits_per_raw_sample set to 24, and format set to AV_SAMPLEFMT_S32.
>> To get the original sample use "(uint32_t)sample >> 8"."
>>
>> Don't know if this is good. (Also is it even correct? I forgot whether
>> audio sample data uses negative values too.) Maybe this should be added
>> to AVCodecContext too. It's a common point of confusion.
> 
> suggested changed made ad applied

Should the change made to matroskaenc be reverted then? It was changed from
using bits_per_raw_sample to bits_per_coded_sample in the codecpar commit
because the former wasn't available back then.

> 
> ill submit a seperae patch for mentioning negative values
> 
> thanks
> 
> [...]
> 
> 
> 
> ___
> 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] avcodec: Add bits_per_raw_sample to AVCodecParameters

2016-04-14 Thread Michael Niedermayer
On Tue, Apr 12, 2016 at 01:25:43PM +0200, wm4 wrote:
> On Tue, 12 Apr 2016 13:10:09 +0200
> Michael Niedermayer  wrote:
> 
> > On Mon, Apr 11, 2016 at 01:32:07AM +0200, Michael Niedermayer wrote:
> > > The bits_per_raw_sample represents the number of bits of precission per 
> > > sample.
> > > 
> > > The field is added at the logical place, not at the end as the code was 
> > > just
> > > recently added
> > > 
> > > This fixes the regression about loosing the audio sample precission 
> > > information
> > > 
> > > The change in the fate test checksum un-does the change from the merge
> > > 
> > > Signed-off-by: Michael Niedermayer 
> > > ---
> > >  libavcodec/avcodec.h |   17 +
> > >  libavcodec/utils.c   |2 ++
> > >  tests/ref/lavf/ffm   |2 +-
> > >  3 files changed, 20 insertions(+), 1 deletion(-)  
> > 
> > new version of this with improved documentation
> > I intend to apply this soon if noone is against
> > 
> > 
> > From e500dd31368b760144b1e2b5b094f73b571b Mon Sep 17 00:00:00 2001
> > From: Michael Niedermayer 
> > Date: Mon, 11 Apr 2016 00:52:21 +0200
> > Subject: [PATCH] avcodec: Add bits_per_raw_sample to AVCodecParameters
> > 
> > The bits_per_raw_sample represents the number of bits of precission per 
> > sample.
> > 
> > The field is added at the logical place, not at the end as the code was just
> > recently added
> > 
> > This fixes the regression about loosing the audio sample precission 
> > information
> > 
> > The change in the fate test checksum un-does the change from the merge
> > 
> > Signed-off-by: Michael Niedermayer 
> > ---
> >  libavcodec/avcodec.h |   21 +
> >  libavcodec/utils.c   |2 ++
> >  tests/ref/lavf/ffm   |2 +-
> >  3 files changed, 24 insertions(+), 1 deletion(-)
> > 
> > diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> > index b3655c5..99cbf88 100644
> > --- a/libavcodec/avcodec.h
> > +++ b/libavcodec/avcodec.h
> > @@ -3832,9 +3832,30 @@ typedef struct AVCodecParameters {
> >   */
> >  int64_t bit_rate;
> > 
> > +/**
> > + * The number of bits per sample in the codedwords.
> > + *
> > + * This is basically the bitrate per sample, it is mandatory for a 
> > bunch of
> > + * formats to actually decode them, its the number of bits for one 
> > sample in
> 
> "It's". Also, add more full stops instead of creating long sentences.
> 
> > + * the actual coded bitstream.
> > + *
> > + * This could be for example 4 for ADPCM
> > + * For PCM formats this matches bits_per_raw_sample
> > + * Can be 0
> > + */
> >  int bits_per_coded_sample;
> > 
> >  /**
> > + * The number of bits of precission in the samples.
> 
> Precision. Just get a spellchecker.
> 
> > + *
> > + * These are the bits in a decoded (raw) sample.
> 
> Maybe: "This is the number of valid bits in each output sample. If the
> sample format has more bits, the least significant bits are additional
> padding bits, which are always 0. Use right shifts to reduce the sample
> to its actual size. For example, audio formats with 24 bit samples will
> have bits_per_raw_sample set to 24, and format set to AV_SAMPLEFMT_S32.
> To get the original sample use "(uint32_t)sample >> 8"."
> 
> Don't know if this is good. (Also is it even correct? I forgot whether
> audio sample data uses negative values too.) Maybe this should be added
> to AVCodecContext too. It's a common point of confusion.

suggested changed made ad applied

ill submit a seperae patch for mentioning negative values

thanks

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I have never wished to cater to the crowd; for what I know they do not
approve, and what they approve I do not know. -- Epicurus


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


Re: [FFmpeg-devel] [PATCH] avcodec: Add bits_per_raw_sample to AVCodecParameters

2016-04-14 Thread Michael Niedermayer
On Tue, Apr 12, 2016 at 01:18:10PM +0200, Dominik 'Rathann' Mierzejewski wrote:
> On Tuesday, 12 April 2016 at 13:10, Michael Niedermayer wrote:
> > new version of this with improved documentation
> > I intend to apply this soon if noone is against
> > 
> > 
> > From e500dd31368b760144b1e2b5b094f73b571b Mon Sep 17 00:00:00 2001
> > From: Michael Niedermayer 
> > Date: Mon, 11 Apr 2016 00:52:21 +0200
> > Subject: [PATCH] avcodec: Add bits_per_raw_sample to AVCodecParameters
> > 
> > The bits_per_raw_sample represents the number of bits of precission per 
> > sample.
> 
> Typo: precision.
> 
> > The field is added at the logical place, not at the end as the code was just
> > recently added
> > 
> > This fixes the regression about loosing the audio sample precission 
> > information
> 
> Typos: losing, precision.
> 
> > The change in the fate test checksum un-does the change from the merge
> > 
> > Signed-off-by: Michael Niedermayer 
> [...]

typos locally fixed


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

No human being will ever know the Truth, for even if they happen to say it
by chance, they would not even known they had done so. -- Xenophanes


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


Re: [FFmpeg-devel] [PATCH] avcodec: Add bits_per_raw_sample to AVCodecParameters

2016-04-12 Thread wm4
On Tue, 12 Apr 2016 13:10:09 +0200
Michael Niedermayer  wrote:

> On Mon, Apr 11, 2016 at 01:32:07AM +0200, Michael Niedermayer wrote:
> > The bits_per_raw_sample represents the number of bits of precission per 
> > sample.
> > 
> > The field is added at the logical place, not at the end as the code was just
> > recently added
> > 
> > This fixes the regression about loosing the audio sample precission 
> > information
> > 
> > The change in the fate test checksum un-does the change from the merge
> > 
> > Signed-off-by: Michael Niedermayer 
> > ---
> >  libavcodec/avcodec.h |   17 +
> >  libavcodec/utils.c   |2 ++
> >  tests/ref/lavf/ffm   |2 +-
> >  3 files changed, 20 insertions(+), 1 deletion(-)  
> 
> new version of this with improved documentation
> I intend to apply this soon if noone is against
> 
> 
> From e500dd31368b760144b1e2b5b094f73b571b Mon Sep 17 00:00:00 2001
> From: Michael Niedermayer 
> Date: Mon, 11 Apr 2016 00:52:21 +0200
> Subject: [PATCH] avcodec: Add bits_per_raw_sample to AVCodecParameters
> 
> The bits_per_raw_sample represents the number of bits of precission per 
> sample.
> 
> The field is added at the logical place, not at the end as the code was just
> recently added
> 
> This fixes the regression about loosing the audio sample precission 
> information
> 
> The change in the fate test checksum un-does the change from the merge
> 
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/avcodec.h |   21 +
>  libavcodec/utils.c   |2 ++
>  tests/ref/lavf/ffm   |2 +-
>  3 files changed, 24 insertions(+), 1 deletion(-)
> 
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index b3655c5..99cbf88 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -3832,9 +3832,30 @@ typedef struct AVCodecParameters {
>   */
>  int64_t bit_rate;
> 
> +/**
> + * The number of bits per sample in the codedwords.
> + *
> + * This is basically the bitrate per sample, it is mandatory for a bunch 
> of
> + * formats to actually decode them, its the number of bits for one 
> sample in

"It's". Also, add more full stops instead of creating long sentences.

> + * the actual coded bitstream.
> + *
> + * This could be for example 4 for ADPCM
> + * For PCM formats this matches bits_per_raw_sample
> + * Can be 0
> + */
>  int bits_per_coded_sample;
> 
>  /**
> + * The number of bits of precission in the samples.

Precision. Just get a spellchecker.

> + *
> + * These are the bits in a decoded (raw) sample.

Maybe: "This is the number of valid bits in each output sample. If the
sample format has more bits, the least significant bits are additional
padding bits, which are always 0. Use right shifts to reduce the sample
to its actual size. For example, audio formats with 24 bit samples will
have bits_per_raw_sample set to 24, and format set to AV_SAMPLEFMT_S32.
To get the original sample use "(uint32_t)sample >> 8"."

Don't know if this is good. (Also is it even correct? I forgot whether
audio sample data uses negative values too.) Maybe this should be added
to AVCodecContext too. It's a common point of confusion.

> + *
> + * For ADPCM this might be 12 or 16 or similar
> + * Can be 0
> + */
> +int bits_per_raw_sample;
> +
> +/**
>   * Codec-specific bitstream restrictions that the stream conforms to.
>   */
>  int profile;
> diff --git a/libavcodec/utils.c b/libavcodec/utils.c
> index c1f8e22..e0edce3 100644
> --- a/libavcodec/utils.c
> +++ b/libavcodec/utils.c
> @@ -3771,6 +3771,7 @@ int avcodec_parameters_from_context(AVCodecParameters 
> *par,
> 
>  par->bit_rate  = codec->bit_rate;
>  par->bits_per_coded_sample = codec->bits_per_coded_sample;
> +par->bits_per_raw_sample   = codec->bits_per_raw_sample;
>  par->profile   = codec->profile;
>  par->level = codec->level;
> 
> @@ -3824,6 +3825,7 @@ int avcodec_parameters_to_context(AVCodecContext *codec,
> 
>  codec->bit_rate  = par->bit_rate;
>  codec->bits_per_coded_sample = par->bits_per_coded_sample;
> +codec->bits_per_raw_sample   = par->bits_per_raw_sample;
>  codec->profile   = par->profile;
>  codec->level = par->level;
> 
> diff --git a/tests/ref/lavf/ffm b/tests/ref/lavf/ffm
> index e45ef08..c4d7e1f 100644
> --- a/tests/ref/lavf/ffm
> +++ b/tests/ref/lavf/ffm
> @@ -1,3 +1,3 @@
> -79674a5219d00e1d2221a29157b35eb4 *./tests/data/lavf/lavf.ffm
> +e63c16b5f0ad5015304fc4009fdb33ca *./tests/data/lavf/lavf.ffm
>  376832 ./tests/data/lavf/lavf.ffm
>  ./tests/data/lavf/lavf.ffm CRC=0x000e23ae
> --
> 1.7.9.5
> 
> [...]

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


Re: [FFmpeg-devel] [PATCH] avcodec: Add bits_per_raw_sample to AVCodecParameters

2016-04-12 Thread Dominik 'Rathann' Mierzejewski
On Tuesday, 12 April 2016 at 13:10, Michael Niedermayer wrote:
> new version of this with improved documentation
> I intend to apply this soon if noone is against
> 
> 
> From e500dd31368b760144b1e2b5b094f73b571b Mon Sep 17 00:00:00 2001
> From: Michael Niedermayer 
> Date: Mon, 11 Apr 2016 00:52:21 +0200
> Subject: [PATCH] avcodec: Add bits_per_raw_sample to AVCodecParameters
> 
> The bits_per_raw_sample represents the number of bits of precission per 
> sample.

Typo: precision.

> The field is added at the logical place, not at the end as the code was just
> recently added
> 
> This fixes the regression about loosing the audio sample precission 
> information

Typos: losing, precision.

> The change in the fate test checksum un-does the change from the merge
> 
> Signed-off-by: Michael Niedermayer 
[...]

Regards,
Dominik
-- 
MPlayer http://mplayerhq.hu | RPM Fusion http://rpmfusion.org
There should be a science of discontent. People need hard times and
oppression to develop psychic muscles.
-- from "Collected Sayings of Muad'Dib" by the Princess Irulan
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec: Add bits_per_raw_sample to AVCodecParameters

2016-04-12 Thread Michael Niedermayer
On Mon, Apr 11, 2016 at 01:32:07AM +0200, Michael Niedermayer wrote:
> The bits_per_raw_sample represents the number of bits of precission per 
> sample.
> 
> The field is added at the logical place, not at the end as the code was just
> recently added
> 
> This fixes the regression about loosing the audio sample precission 
> information
> 
> The change in the fate test checksum un-does the change from the merge
> 
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/avcodec.h |   17 +
>  libavcodec/utils.c   |2 ++
>  tests/ref/lavf/ffm   |2 +-
>  3 files changed, 20 insertions(+), 1 deletion(-)

new version of this with improved documentation
I intend to apply this soon if noone is against


From e500dd31368b760144b1e2b5b094f73b571b Mon Sep 17 00:00:00 2001
From: Michael Niedermayer 
Date: Mon, 11 Apr 2016 00:52:21 +0200
Subject: [PATCH] avcodec: Add bits_per_raw_sample to AVCodecParameters

The bits_per_raw_sample represents the number of bits of precission per sample.

The field is added at the logical place, not at the end as the code was just
recently added

This fixes the regression about loosing the audio sample precission information

The change in the fate test checksum un-does the change from the merge

Signed-off-by: Michael Niedermayer 
---
 libavcodec/avcodec.h |   21 +
 libavcodec/utils.c   |2 ++
 tests/ref/lavf/ffm   |2 +-
 3 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index b3655c5..99cbf88 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -3832,9 +3832,30 @@ typedef struct AVCodecParameters {
  */
 int64_t bit_rate;

+/**
+ * The number of bits per sample in the codedwords.
+ *
+ * This is basically the bitrate per sample, it is mandatory for a bunch of
+ * formats to actually decode them, its the number of bits for one sample 
in
+ * the actual coded bitstream.
+ *
+ * This could be for example 4 for ADPCM
+ * For PCM formats this matches bits_per_raw_sample
+ * Can be 0
+ */
 int bits_per_coded_sample;

 /**
+ * The number of bits of precission in the samples.
+ *
+ * These are the bits in a decoded (raw) sample.
+ *
+ * For ADPCM this might be 12 or 16 or similar
+ * Can be 0
+ */
+int bits_per_raw_sample;
+
+/**
  * Codec-specific bitstream restrictions that the stream conforms to.
  */
 int profile;
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index c1f8e22..e0edce3 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -3771,6 +3771,7 @@ int avcodec_parameters_from_context(AVCodecParameters 
*par,

 par->bit_rate  = codec->bit_rate;
 par->bits_per_coded_sample = codec->bits_per_coded_sample;
+par->bits_per_raw_sample   = codec->bits_per_raw_sample;
 par->profile   = codec->profile;
 par->level = codec->level;

@@ -3824,6 +3825,7 @@ int avcodec_parameters_to_context(AVCodecContext *codec,

 codec->bit_rate  = par->bit_rate;
 codec->bits_per_coded_sample = par->bits_per_coded_sample;
+codec->bits_per_raw_sample   = par->bits_per_raw_sample;
 codec->profile   = par->profile;
 codec->level = par->level;

diff --git a/tests/ref/lavf/ffm b/tests/ref/lavf/ffm
index e45ef08..c4d7e1f 100644
--- a/tests/ref/lavf/ffm
+++ b/tests/ref/lavf/ffm
@@ -1,3 +1,3 @@
-79674a5219d00e1d2221a29157b35eb4 *./tests/data/lavf/lavf.ffm
+e63c16b5f0ad5015304fc4009fdb33ca *./tests/data/lavf/lavf.ffm
 376832 ./tests/data/lavf/lavf.ffm
 ./tests/data/lavf/lavf.ffm CRC=0x000e23ae
--
1.7.9.5

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

Rewriting code that is poorly written but fully understood is good.
Rewriting code that one doesnt understand is a sign that one is less smart
then the original author, trying to rewrite it will not make it better.


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


Re: [FFmpeg-devel] [PATCH] avcodec: Add bits_per_raw_sample to AVCodecParameters

2016-04-11 Thread wm4
On Mon, 11 Apr 2016 13:26:54 +0200
Hendrik Leppkes  wrote:

> On Mon, Apr 11, 2016 at 1:17 PM, wm4  wrote:
> > On Mon, 11 Apr 2016 12:52:51 +0200
> > Hendrik Leppkes  wrote:
> >  
> >> On Mon, Apr 11, 2016 at 11:29 AM, wm4  wrote:  
> >> > On Mon, 11 Apr 2016 03:12:20 +0200
> >> > Michael Niedermayer  wrote:
> >> >  
> >> >> On Sun, Apr 10, 2016 at 11:39:57PM +, Kieran Kunhya wrote:  
> >> >> > On Mon, 11 Apr 2016 at 00:33 Michael Niedermayer 
> >> >> > 
> >> >> > wrote:
> >> >> >  
> >> >> > > The bits_per_raw_sample represents the number of bits of precission 
> >> >> > > per
> >> >> > > sample.
> >> >> > >
> >> >> > > The field is added at the logical place, not at the end as the code 
> >> >> > > was
> >> >> > > just
> >> >> > > recently added
> >> >> > >
> >> >> > > This fixes the regression about loosing the audio sample precission
> >> >> > > information
> >> >> > >
> >> >> > > The change in the fate test checksum un-does the change from the 
> >> >> > > merge
> >> >> > >
> >> >> > > Signed-off-by: Michael Niedermayer 
> >> >> > > ---
> >> >> > >  libavcodec/avcodec.h |   17 +
> >> >> > >  libavcodec/utils.c   |2 ++
> >> >> > >  tests/ref/lavf/ffm   |2 +-
> >> >> > >  3 files changed, 20 insertions(+), 1 deletion(-)
> >> >> > >
> >> >> > > diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> >> >> > > index b3655c5..87739d7 100644
> >> >> > > --- a/libavcodec/avcodec.h
> >> >> > > +++ b/libavcodec/avcodec.h
> >> >> > > @@ -3832,9 +3832,26 @@ typedef struct AVCodecParameters {
> >> >> > >   */
> >> >> > >  int64_t bit_rate;
> >> >> > >
> >> >> > > +/**
> >> >> > > + * The number of bits per sample in the codedwords.
> >> >> > > + *
> >> >> > > + * This is basically the bitrate per sample
> >> >> > > + *
> >> >> > > + * This could be for example 4 for ADPCM
> >> >> > > + * For PCM formats this matches bits_per_raw_sample
> >> >> > > + * Can be 0
> >> >> > > + */
> >> >> > >  int bits_per_coded_sample;
> >> >> > >
> >> >> > >  /**
> >> >> > > + * The number of bits of precission in the samples.
> >> >> > > + *
> >> >> > > + * For ADPCM this might be 12 or 16 or similar
> >> >> > > + * Can be 0
> >> >> > > + */
> >> >> > > +int bits_per_raw_sample;
> >> >> > >
> >> >> > >  
> >> >> > Precision spelt wrong. Also needs more clarification as to the 
> >> >> > difference
> >> >> > between the two  
> >> >>
> >> >> on one side of a bitstream format there is raw pcm data (raw samples)
> >> >> and on the other a compressed bitstream (aka coded samples)
> >> >> these 2 where intended to specify the number of bits per sample in
> >> >> these 2 representations
> >> >>
> >> >> i really dont know how to word this so that its clear and everyone
> >> >> understands it
> >> >>
> >> >>  
> >> >> > - I have no idea what the difference is or why one would
> >> >> > use bits_per_coded_sample for anything.  
> >> >>
> >> >> bits_per_coded_sample is used by several codecs (huffyuv, ima adpcm,
> >> >> ...) in avi as a single byte extradata. so it must be transported from
> >> >> the demuxer (avi headers) to the decoder and encoder to muxer
> >> >> to make this worse, in some of these codecs it matches the
> >> >> bits_per_raw_sample, in some it does not  
> >> >
> >> > I still don't understand. bits_per_coded_sample is part of the
> >> > AVCodecParameters struct. So what's the difference between per_coded
> >> > and per_raw?
> >> >  
> >>
> >> As I understand it, coded is mandatory for a bunch of formats to
> >> actually decode it, ie. the number of bits for one sample in the
> >> actual coded bitstream.
> >> And raw is just the bits in a decoded (raw) sample. Sometimes those
> >> two can be the same, especially if the codec in question doesnt have a
> >> concept of coded bits per sample.  
> >
> > Then I don't understand why the field can't be reused.
> >
> > One thing that would have to be done though is copying the field to the
> > AVCodecContext.bits_per_raw_sample field in decoder init or so.  
> 
> How can it be reused if you practically have two values? One for
> coded, and one for raw? One is mandatory for decoding, and one is good
> to know so you can interpret S32 sample format properly.

It's only a problem if they collide, but maybe it's really better to
have them separate to avoid a potential mess.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec: Add bits_per_raw_sample to AVCodecParameters

2016-04-11 Thread Hendrik Leppkes
On Mon, Apr 11, 2016 at 1:17 PM, wm4  wrote:
> On Mon, 11 Apr 2016 12:52:51 +0200
> Hendrik Leppkes  wrote:
>
>> On Mon, Apr 11, 2016 at 11:29 AM, wm4  wrote:
>> > On Mon, 11 Apr 2016 03:12:20 +0200
>> > Michael Niedermayer  wrote:
>> >
>> >> On Sun, Apr 10, 2016 at 11:39:57PM +, Kieran Kunhya wrote:
>> >> > On Mon, 11 Apr 2016 at 00:33 Michael Niedermayer 
>> >> > 
>> >> > wrote:
>> >> >
>> >> > > The bits_per_raw_sample represents the number of bits of precission 
>> >> > > per
>> >> > > sample.
>> >> > >
>> >> > > The field is added at the logical place, not at the end as the code 
>> >> > > was
>> >> > > just
>> >> > > recently added
>> >> > >
>> >> > > This fixes the regression about loosing the audio sample precission
>> >> > > information
>> >> > >
>> >> > > The change in the fate test checksum un-does the change from the merge
>> >> > >
>> >> > > Signed-off-by: Michael Niedermayer 
>> >> > > ---
>> >> > >  libavcodec/avcodec.h |   17 +
>> >> > >  libavcodec/utils.c   |2 ++
>> >> > >  tests/ref/lavf/ffm   |2 +-
>> >> > >  3 files changed, 20 insertions(+), 1 deletion(-)
>> >> > >
>> >> > > diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
>> >> > > index b3655c5..87739d7 100644
>> >> > > --- a/libavcodec/avcodec.h
>> >> > > +++ b/libavcodec/avcodec.h
>> >> > > @@ -3832,9 +3832,26 @@ typedef struct AVCodecParameters {
>> >> > >   */
>> >> > >  int64_t bit_rate;
>> >> > >
>> >> > > +/**
>> >> > > + * The number of bits per sample in the codedwords.
>> >> > > + *
>> >> > > + * This is basically the bitrate per sample
>> >> > > + *
>> >> > > + * This could be for example 4 for ADPCM
>> >> > > + * For PCM formats this matches bits_per_raw_sample
>> >> > > + * Can be 0
>> >> > > + */
>> >> > >  int bits_per_coded_sample;
>> >> > >
>> >> > >  /**
>> >> > > + * The number of bits of precission in the samples.
>> >> > > + *
>> >> > > + * For ADPCM this might be 12 or 16 or similar
>> >> > > + * Can be 0
>> >> > > + */
>> >> > > +int bits_per_raw_sample;
>> >> > >
>> >> > >
>> >> > Precision spelt wrong. Also needs more clarification as to the 
>> >> > difference
>> >> > between the two
>> >>
>> >> on one side of a bitstream format there is raw pcm data (raw samples)
>> >> and on the other a compressed bitstream (aka coded samples)
>> >> these 2 where intended to specify the number of bits per sample in
>> >> these 2 representations
>> >>
>> >> i really dont know how to word this so that its clear and everyone
>> >> understands it
>> >>
>> >>
>> >> > - I have no idea what the difference is or why one would
>> >> > use bits_per_coded_sample for anything.
>> >>
>> >> bits_per_coded_sample is used by several codecs (huffyuv, ima adpcm,
>> >> ...) in avi as a single byte extradata. so it must be transported from
>> >> the demuxer (avi headers) to the decoder and encoder to muxer
>> >> to make this worse, in some of these codecs it matches the
>> >> bits_per_raw_sample, in some it does not
>> >
>> > I still don't understand. bits_per_coded_sample is part of the
>> > AVCodecParameters struct. So what's the difference between per_coded
>> > and per_raw?
>> >
>>
>> As I understand it, coded is mandatory for a bunch of formats to
>> actually decode it, ie. the number of bits for one sample in the
>> actual coded bitstream.
>> And raw is just the bits in a decoded (raw) sample. Sometimes those
>> two can be the same, especially if the codec in question doesnt have a
>> concept of coded bits per sample.
>
> Then I don't understand why the field can't be reused.
>
> One thing that would have to be done though is copying the field to the
> AVCodecContext.bits_per_raw_sample field in decoder init or so.

How can it be reused if you practically have two values? One for
coded, and one for raw? One is mandatory for decoding, and one is good
to know so you can interpret S32 sample format properly.

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


Re: [FFmpeg-devel] [PATCH] avcodec: Add bits_per_raw_sample to AVCodecParameters

2016-04-11 Thread wm4
On Mon, 11 Apr 2016 12:52:51 +0200
Hendrik Leppkes  wrote:

> On Mon, Apr 11, 2016 at 11:29 AM, wm4  wrote:
> > On Mon, 11 Apr 2016 03:12:20 +0200
> > Michael Niedermayer  wrote:
> >  
> >> On Sun, Apr 10, 2016 at 11:39:57PM +, Kieran Kunhya wrote:  
> >> > On Mon, 11 Apr 2016 at 00:33 Michael Niedermayer 
> >> > wrote:
> >> >  
> >> > > The bits_per_raw_sample represents the number of bits of precission per
> >> > > sample.
> >> > >
> >> > > The field is added at the logical place, not at the end as the code was
> >> > > just
> >> > > recently added
> >> > >
> >> > > This fixes the regression about loosing the audio sample precission
> >> > > information
> >> > >
> >> > > The change in the fate test checksum un-does the change from the merge
> >> > >
> >> > > Signed-off-by: Michael Niedermayer 
> >> > > ---
> >> > >  libavcodec/avcodec.h |   17 +
> >> > >  libavcodec/utils.c   |2 ++
> >> > >  tests/ref/lavf/ffm   |2 +-
> >> > >  3 files changed, 20 insertions(+), 1 deletion(-)
> >> > >
> >> > > diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> >> > > index b3655c5..87739d7 100644
> >> > > --- a/libavcodec/avcodec.h
> >> > > +++ b/libavcodec/avcodec.h
> >> > > @@ -3832,9 +3832,26 @@ typedef struct AVCodecParameters {
> >> > >   */
> >> > >  int64_t bit_rate;
> >> > >
> >> > > +/**
> >> > > + * The number of bits per sample in the codedwords.
> >> > > + *
> >> > > + * This is basically the bitrate per sample
> >> > > + *
> >> > > + * This could be for example 4 for ADPCM
> >> > > + * For PCM formats this matches bits_per_raw_sample
> >> > > + * Can be 0
> >> > > + */
> >> > >  int bits_per_coded_sample;
> >> > >
> >> > >  /**
> >> > > + * The number of bits of precission in the samples.
> >> > > + *
> >> > > + * For ADPCM this might be 12 or 16 or similar
> >> > > + * Can be 0
> >> > > + */
> >> > > +int bits_per_raw_sample;
> >> > >
> >> > >  
> >> > Precision spelt wrong. Also needs more clarification as to the difference
> >> > between the two  
> >>
> >> on one side of a bitstream format there is raw pcm data (raw samples)
> >> and on the other a compressed bitstream (aka coded samples)
> >> these 2 where intended to specify the number of bits per sample in
> >> these 2 representations
> >>
> >> i really dont know how to word this so that its clear and everyone
> >> understands it
> >>
> >>  
> >> > - I have no idea what the difference is or why one would
> >> > use bits_per_coded_sample for anything.  
> >>
> >> bits_per_coded_sample is used by several codecs (huffyuv, ima adpcm,
> >> ...) in avi as a single byte extradata. so it must be transported from
> >> the demuxer (avi headers) to the decoder and encoder to muxer
> >> to make this worse, in some of these codecs it matches the
> >> bits_per_raw_sample, in some it does not  
> >
> > I still don't understand. bits_per_coded_sample is part of the
> > AVCodecParameters struct. So what's the difference between per_coded
> > and per_raw?
> >  
> 
> As I understand it, coded is mandatory for a bunch of formats to
> actually decode it, ie. the number of bits for one sample in the
> actual coded bitstream.
> And raw is just the bits in a decoded (raw) sample. Sometimes those
> two can be the same, especially if the codec in question doesnt have a
> concept of coded bits per sample.

Then I don't understand why the field can't be reused.

One thing that would have to be done though is copying the field to the
AVCodecContext.bits_per_raw_sample field in decoder init or so.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec: Add bits_per_raw_sample to AVCodecParameters

2016-04-11 Thread Hendrik Leppkes
On Mon, Apr 11, 2016 at 11:29 AM, wm4  wrote:
> On Mon, 11 Apr 2016 03:12:20 +0200
> Michael Niedermayer  wrote:
>
>> On Sun, Apr 10, 2016 at 11:39:57PM +, Kieran Kunhya wrote:
>> > On Mon, 11 Apr 2016 at 00:33 Michael Niedermayer 
>> > wrote:
>> >
>> > > The bits_per_raw_sample represents the number of bits of precission per
>> > > sample.
>> > >
>> > > The field is added at the logical place, not at the end as the code was
>> > > just
>> > > recently added
>> > >
>> > > This fixes the regression about loosing the audio sample precission
>> > > information
>> > >
>> > > The change in the fate test checksum un-does the change from the merge
>> > >
>> > > Signed-off-by: Michael Niedermayer 
>> > > ---
>> > >  libavcodec/avcodec.h |   17 +
>> > >  libavcodec/utils.c   |2 ++
>> > >  tests/ref/lavf/ffm   |2 +-
>> > >  3 files changed, 20 insertions(+), 1 deletion(-)
>> > >
>> > > diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
>> > > index b3655c5..87739d7 100644
>> > > --- a/libavcodec/avcodec.h
>> > > +++ b/libavcodec/avcodec.h
>> > > @@ -3832,9 +3832,26 @@ typedef struct AVCodecParameters {
>> > >   */
>> > >  int64_t bit_rate;
>> > >
>> > > +/**
>> > > + * The number of bits per sample in the codedwords.
>> > > + *
>> > > + * This is basically the bitrate per sample
>> > > + *
>> > > + * This could be for example 4 for ADPCM
>> > > + * For PCM formats this matches bits_per_raw_sample
>> > > + * Can be 0
>> > > + */
>> > >  int bits_per_coded_sample;
>> > >
>> > >  /**
>> > > + * The number of bits of precission in the samples.
>> > > + *
>> > > + * For ADPCM this might be 12 or 16 or similar
>> > > + * Can be 0
>> > > + */
>> > > +int bits_per_raw_sample;
>> > >
>> > >
>> > Precision spelt wrong. Also needs more clarification as to the difference
>> > between the two
>>
>> on one side of a bitstream format there is raw pcm data (raw samples)
>> and on the other a compressed bitstream (aka coded samples)
>> these 2 where intended to specify the number of bits per sample in
>> these 2 representations
>>
>> i really dont know how to word this so that its clear and everyone
>> understands it
>>
>>
>> > - I have no idea what the difference is or why one would
>> > use bits_per_coded_sample for anything.
>>
>> bits_per_coded_sample is used by several codecs (huffyuv, ima adpcm,
>> ...) in avi as a single byte extradata. so it must be transported from
>> the demuxer (avi headers) to the decoder and encoder to muxer
>> to make this worse, in some of these codecs it matches the
>> bits_per_raw_sample, in some it does not
>
> I still don't understand. bits_per_coded_sample is part of the
> AVCodecParameters struct. So what's the difference between per_coded
> and per_raw?
>

As I understand it, coded is mandatory for a bunch of formats to
actually decode it, ie. the number of bits for one sample in the
actual coded bitstream.
And raw is just the bits in a decoded (raw) sample. Sometimes those
two can be the same, especially if the codec in question doesnt have a
concept of coded bits per sample.

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


Re: [FFmpeg-devel] [PATCH] avcodec: Add bits_per_raw_sample to AVCodecParameters

2016-04-11 Thread Paul B Mahol
On 4/11/16, wm4  wrote:
> On Mon, 11 Apr 2016 03:12:20 +0200
> Michael Niedermayer  wrote:
>
>> On Sun, Apr 10, 2016 at 11:39:57PM +, Kieran Kunhya wrote:
>> > On Mon, 11 Apr 2016 at 00:33 Michael Niedermayer
>> > 
>> > wrote:
>> >
>> > > The bits_per_raw_sample represents the number of bits of precission
>> > > per
>> > > sample.
>> > >
>> > > The field is added at the logical place, not at the end as the code
>> > > was
>> > > just
>> > > recently added
>> > >
>> > > This fixes the regression about loosing the audio sample precission
>> > > information
>> > >
>> > > The change in the fate test checksum un-does the change from the merge
>> > >
>> > > Signed-off-by: Michael Niedermayer 
>> > > ---
>> > >  libavcodec/avcodec.h |   17 +
>> > >  libavcodec/utils.c   |2 ++
>> > >  tests/ref/lavf/ffm   |2 +-
>> > >  3 files changed, 20 insertions(+), 1 deletion(-)
>> > >
>> > > diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
>> > > index b3655c5..87739d7 100644
>> > > --- a/libavcodec/avcodec.h
>> > > +++ b/libavcodec/avcodec.h
>> > > @@ -3832,9 +3832,26 @@ typedef struct AVCodecParameters {
>> > >   */
>> > >  int64_t bit_rate;
>> > >
>> > > +/**
>> > > + * The number of bits per sample in the codedwords.
>> > > + *
>> > > + * This is basically the bitrate per sample
>> > > + *
>> > > + * This could be for example 4 for ADPCM
>> > > + * For PCM formats this matches bits_per_raw_sample
>> > > + * Can be 0
>> > > + */
>> > >  int bits_per_coded_sample;
>> > >
>> > >  /**
>> > > + * The number of bits of precission in the samples.
>> > > + *
>> > > + * For ADPCM this might be 12 or 16 or similar
>> > > + * Can be 0
>> > > + */
>> > > +int bits_per_raw_sample;
>> > >
>> > >
>> > Precision spelt wrong. Also needs more clarification as to the
>> > difference
>> > between the two
>>
>> on one side of a bitstream format there is raw pcm data (raw samples)
>> and on the other a compressed bitstream (aka coded samples)
>> these 2 where intended to specify the number of bits per sample in
>> these 2 representations
>>
>> i really dont know how to word this so that its clear and everyone
>> understands it
>>
>>
>> > - I have no idea what the difference is or why one would
>> > use bits_per_coded_sample for anything.
>>
>> bits_per_coded_sample is used by several codecs (huffyuv, ima adpcm,
>> ...) in avi as a single byte extradata. so it must be transported from
>> the demuxer (avi headers) to the decoder and encoder to muxer
>> to make this worse, in some of these codecs it matches the
>> bits_per_raw_sample, in some it does not
>
> I still don't understand. bits_per_coded_sample is part of the
> AVCodecParameters struct. So what's the difference between per_coded
> and per_raw?

bits per coded can be different from bits per raw sample.

For ADPCM its usually 4 for codeded and 16 for raw.

>
> ___
> 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] avcodec: Add bits_per_raw_sample to AVCodecParameters

2016-04-11 Thread wm4
On Mon, 11 Apr 2016 03:12:20 +0200
Michael Niedermayer  wrote:

> On Sun, Apr 10, 2016 at 11:39:57PM +, Kieran Kunhya wrote:
> > On Mon, 11 Apr 2016 at 00:33 Michael Niedermayer 
> > wrote:
> >   
> > > The bits_per_raw_sample represents the number of bits of precission per
> > > sample.
> > >
> > > The field is added at the logical place, not at the end as the code was
> > > just
> > > recently added
> > >
> > > This fixes the regression about loosing the audio sample precission
> > > information
> > >
> > > The change in the fate test checksum un-does the change from the merge
> > >
> > > Signed-off-by: Michael Niedermayer 
> > > ---
> > >  libavcodec/avcodec.h |   17 +
> > >  libavcodec/utils.c   |2 ++
> > >  tests/ref/lavf/ffm   |2 +-
> > >  3 files changed, 20 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> > > index b3655c5..87739d7 100644
> > > --- a/libavcodec/avcodec.h
> > > +++ b/libavcodec/avcodec.h
> > > @@ -3832,9 +3832,26 @@ typedef struct AVCodecParameters {
> > >   */
> > >  int64_t bit_rate;
> > >
> > > +/**
> > > + * The number of bits per sample in the codedwords.
> > > + *
> > > + * This is basically the bitrate per sample
> > > + *
> > > + * This could be for example 4 for ADPCM
> > > + * For PCM formats this matches bits_per_raw_sample
> > > + * Can be 0
> > > + */
> > >  int bits_per_coded_sample;
> > >
> > >  /**
> > > + * The number of bits of precission in the samples.
> > > + *
> > > + * For ADPCM this might be 12 or 16 or similar
> > > + * Can be 0
> > > + */
> > > +int bits_per_raw_sample;
> > >
> > >  
> > Precision spelt wrong. Also needs more clarification as to the difference
> > between the two  
> 
> on one side of a bitstream format there is raw pcm data (raw samples)
> and on the other a compressed bitstream (aka coded samples)
> these 2 where intended to specify the number of bits per sample in
> these 2 representations
> 
> i really dont know how to word this so that its clear and everyone
> understands it
> 
> 
> > - I have no idea what the difference is or why one would
> > use bits_per_coded_sample for anything.  
> 
> bits_per_coded_sample is used by several codecs (huffyuv, ima adpcm,
> ...) in avi as a single byte extradata. so it must be transported from
> the demuxer (avi headers) to the decoder and encoder to muxer
> to make this worse, in some of these codecs it matches the
> bits_per_raw_sample, in some it does not

I still don't understand. bits_per_coded_sample is part of the
AVCodecParameters struct. So what's the difference between per_coded
and per_raw?

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


Re: [FFmpeg-devel] [PATCH] avcodec: Add bits_per_raw_sample to AVCodecParameters

2016-04-10 Thread Michael Niedermayer
On Sun, Apr 10, 2016 at 11:39:57PM +, Kieran Kunhya wrote:
> On Mon, 11 Apr 2016 at 00:33 Michael Niedermayer 
> wrote:
> 
> > The bits_per_raw_sample represents the number of bits of precission per
> > sample.
> >
> > The field is added at the logical place, not at the end as the code was
> > just
> > recently added
> >
> > This fixes the regression about loosing the audio sample precission
> > information
> >
> > The change in the fate test checksum un-does the change from the merge
> >
> > Signed-off-by: Michael Niedermayer 
> > ---
> >  libavcodec/avcodec.h |   17 +
> >  libavcodec/utils.c   |2 ++
> >  tests/ref/lavf/ffm   |2 +-
> >  3 files changed, 20 insertions(+), 1 deletion(-)
> >
> > diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> > index b3655c5..87739d7 100644
> > --- a/libavcodec/avcodec.h
> > +++ b/libavcodec/avcodec.h
> > @@ -3832,9 +3832,26 @@ typedef struct AVCodecParameters {
> >   */
> >  int64_t bit_rate;
> >
> > +/**
> > + * The number of bits per sample in the codedwords.
> > + *
> > + * This is basically the bitrate per sample
> > + *
> > + * This could be for example 4 for ADPCM
> > + * For PCM formats this matches bits_per_raw_sample
> > + * Can be 0
> > + */
> >  int bits_per_coded_sample;
> >
> >  /**
> > + * The number of bits of precission in the samples.
> > + *
> > + * For ADPCM this might be 12 or 16 or similar
> > + * Can be 0
> > + */
> > +int bits_per_raw_sample;
> >
> >
> Precision spelt wrong. Also needs more clarification as to the difference
> between the two

on one side of a bitstream format there is raw pcm data (raw samples)
and on the other a compressed bitstream (aka coded samples)
these 2 where intended to specify the number of bits per sample in
these 2 representations

i really dont know how to word this so that its clear and everyone
understands it


> - I have no idea what the difference is or why one would
> use bits_per_coded_sample for anything.

bits_per_coded_sample is used by several codecs (huffyuv, ima adpcm,
...) in avi as a single byte extradata. so it must be transported from
the demuxer (avi headers) to the decoder and encoder to muxer
to make this worse, in some of these codecs it matches the
bits_per_raw_sample, in some it does not


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

The misfortune of the wise is better than the prosperity of the fool.
-- Epicurus


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


Re: [FFmpeg-devel] [PATCH] avcodec: Add bits_per_raw_sample to AVCodecParameters

2016-04-10 Thread Michael Niedermayer
On Mon, Apr 11, 2016 at 12:40:43AM +0100, Derek Buitenhuis wrote:
> On 4/11/2016 12:32 AM, Michael Niedermayer wrote:
> > The bits_per_raw_sample represents the number of bits of precission per 
> > sample.
> > 
> > The field is added at the logical place, not at the end as the code was just
> > recently added
> > 
> > This fixes the regression about loosing the audio sample precission 
> > information
> > 
> > The change in the fate test checksum un-does the change from the merge
> > 
> > Signed-off-by: Michael Niedermayer 
> > ---
> >  libavcodec/avcodec.h |   17 +
> >  libavcodec/utils.c   |2 ++
> >  tests/ref/lavf/ffm   |2 +-
> >  3 files changed, 20 insertions(+), 1 deletion(-)
> 
> Is this ever used for anything other than identifying 24-bit PCM?

dts, flac and wmalossless use it too


> I always wondered why we just didn't have a 24-bit PCM format.
> 

> Also, if this is applied, you should update matroskaenc.c to use it.

i noticed that one already when greping for changes to these fields

thx

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Those who would give up essential Liberty, to purchase a little
temporary Safety, deserve neither Liberty nor Safety -- Benjamin Franklin


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


Re: [FFmpeg-devel] [PATCH] avcodec: Add bits_per_raw_sample to AVCodecParameters

2016-04-10 Thread Derek Buitenhuis
On 4/11/2016 12:32 AM, Michael Niedermayer wrote:
> The bits_per_raw_sample represents the number of bits of precission per 
> sample.
> 
> The field is added at the logical place, not at the end as the code was just
> recently added
> 
> This fixes the regression about loosing the audio sample precission 
> information
> 
> The change in the fate test checksum un-does the change from the merge
> 
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/avcodec.h |   17 +
>  libavcodec/utils.c   |2 ++
>  tests/ref/lavf/ffm   |2 +-
>  3 files changed, 20 insertions(+), 1 deletion(-)

Is this ever used for anything other than identifying 24-bit PCM?
I always wondered why we just didn't have a 24-bit PCM format.

Also, if this is applied, you should update matroskaenc.c to use it.

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


Re: [FFmpeg-devel] [PATCH] avcodec: Add bits_per_raw_sample to AVCodecParameters

2016-04-10 Thread Kieran Kunhya
On Mon, 11 Apr 2016 at 00:33 Michael Niedermayer 
wrote:

> The bits_per_raw_sample represents the number of bits of precission per
> sample.
>
> The field is added at the logical place, not at the end as the code was
> just
> recently added
>
> This fixes the regression about loosing the audio sample precission
> information
>
> The change in the fate test checksum un-does the change from the merge
>
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/avcodec.h |   17 +
>  libavcodec/utils.c   |2 ++
>  tests/ref/lavf/ffm   |2 +-
>  3 files changed, 20 insertions(+), 1 deletion(-)
>
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index b3655c5..87739d7 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -3832,9 +3832,26 @@ typedef struct AVCodecParameters {
>   */
>  int64_t bit_rate;
>
> +/**
> + * The number of bits per sample in the codedwords.
> + *
> + * This is basically the bitrate per sample
> + *
> + * This could be for example 4 for ADPCM
> + * For PCM formats this matches bits_per_raw_sample
> + * Can be 0
> + */
>  int bits_per_coded_sample;
>
>  /**
> + * The number of bits of precission in the samples.
> + *
> + * For ADPCM this might be 12 or 16 or similar
> + * Can be 0
> + */
> +int bits_per_raw_sample;
>
>
Precision spelt wrong. Also needs more clarification as to the difference
between the two - I have no idea what the difference is or why one would
use bits_per_coded_sample for anything.

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