Re: [libav-devel] [PATCH 1/4] Add request_sample_fmt field to AVCodecContext.

2011-04-22 Thread Justin Ruggles
On 04/21/2011 07:02 PM, Måns Rullgård wrote:

> Justin Ruggles  writes:
> 
>> On 04/21/2011 01:23 PM, Justin Ruggles wrote:
>>
>>>
>>> This will allow audio decoders to support output of different sample formats
>>> as a runtime option.
>>> ---
>>>  libavcodec/avcodec.h |7 +++
>>>  libavcodec/options.c |6 ++
>>>  libavcodec/version.h |2 +-
>>>  3 files changed, 14 insertions(+), 1 deletions(-)
>>
>> After some discussions on IRC, I've decided to drop this patch set.
>>
>> The final goal is to have audio decoders output only in their native
>> sample format.  Adapting the ffmpeg tool to handle multiple decoder
>> sample formats is possible, but it's proving too messy to be worth it as
>> a temporary solution.  I'll submit a new patch set which will use a
>> configure option like in FFmpeg.
> 
> What about codecs with alternative implementations?  I really, really
> dislike the current hack with separate _names_ for the codecs.
> Selecting implementation based on requested format doesn't seem right,
> but it is certainly related.


Selecting based on sample format doesn't seem right to me either.  It's
an arbitrary way of selecting the encoder.  The 2 ac3 encoders do
different things internally, unrelated to the original sample format.
Also, since most souce audio is *not* floating-point, making the encoder
choice based on sample format would essentially make the fixed-point
encoder the default, which is not ideal since it is lower quality.

Just a wild idea...
- a single encoder
- fixed_point codec-specific option
- accept both S16 and FLT
- convert internally if necessary during deinterleaving


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


Re: [libav-devel] [PATCH 1/4] Add request_sample_fmt field to AVCodecContext.

2011-04-21 Thread Måns Rullgård
Justin Ruggles  writes:

> On 04/21/2011 01:23 PM, Justin Ruggles wrote:
>
>> 
>> This will allow audio decoders to support output of different sample formats
>> as a runtime option.
>> ---
>>  libavcodec/avcodec.h |7 +++
>>  libavcodec/options.c |6 ++
>>  libavcodec/version.h |2 +-
>>  3 files changed, 14 insertions(+), 1 deletions(-)
>
> After some discussions on IRC, I've decided to drop this patch set.
>
> The final goal is to have audio decoders output only in their native
> sample format.  Adapting the ffmpeg tool to handle multiple decoder
> sample formats is possible, but it's proving too messy to be worth it as
> a temporary solution.  I'll submit a new patch set which will use a
> configure option like in FFmpeg.

What about codecs with alternative implementations?  I really, really
dislike the current hack with separate _names_ for the codecs.
Selecting implementation based on requested format doesn't seem right,
but it is certainly related.

-- 
Måns Rullgård
m...@mansr.com
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 1/4] Add request_sample_fmt field to AVCodecContext.

2011-04-21 Thread Justin Ruggles
On 04/21/2011 01:23 PM, Justin Ruggles wrote:

> 
> This will allow audio decoders to support output of different sample formats
> as a runtime option.
> ---
>  libavcodec/avcodec.h |7 +++
>  libavcodec/options.c |6 ++
>  libavcodec/version.h |2 +-
>  3 files changed, 14 insertions(+), 1 deletions(-)


After some discussions on IRC, I've decided to drop this patch set.

The final goal is to have audio decoders output only in their native
sample format.  Adapting the ffmpeg tool to handle multiple decoder
sample formats is possible, but it's proving too messy to be worth it as
a temporary solution.  I'll submit a new patch set which will use a
configure option like in FFmpeg.

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


Re: [libav-devel] [PATCH 1/4] Add request_sample_fmt field to AVCodecContext.

2011-04-21 Thread Aℓex Converse
On Thu, Apr 21, 2011 at 10:23 AM, Justin Ruggles
 wrote:
>
> This will allow audio decoders to support output of different sample formats
> as a runtime option.
> ---
>  libavcodec/avcodec.h |    7 +++
>  libavcodec/options.c |    6 ++
>  libavcodec/version.h |    2 +-
>  3 files changed, 14 insertions(+), 1 deletions(-)
>

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


Re: [libav-devel] [PATCH 1/4] Add request_sample_fmt field to AVCodecContext.

2011-04-21 Thread Diego Biurrun
On Thu, Apr 21, 2011 at 01:23:14PM -0400, Justin Ruggles wrote:
> 
> --- a/libavcodec/version.h
> +++ b/libavcodec/version.h
> @@ -21,7 +21,7 @@
>  #define AVCODEC_VERSION_H
>  
>  #define LIBAVCODEC_VERSION_MAJOR 53
> -#define LIBAVCODEC_VERSION_MINOR  0
> +#define LIBAVCODEC_VERSION_MINOR  1
>  #define LIBAVCODEC_VERSION_MICRO  0

First bump after the big one :)

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


[libav-devel] [PATCH 1/4] Add request_sample_fmt field to AVCodecContext.

2011-04-21 Thread Justin Ruggles

This will allow audio decoders to support output of different sample formats
as a runtime option.
---
 libavcodec/avcodec.h |7 +++
 libavcodec/options.c |6 ++
 libavcodec/version.h |2 +-
 3 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 7727ad0..af9f6d5 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -2850,6 +2850,13 @@ typedef struct AVCodecContext {
  * - decoding: Set by libavcodec.
  */
 enum AVAudioServiceType audio_service_type;
+
+/**
+ * Used to request a sample format from the decoder.
+ * - encoding: unused.
+ * - decoding: Set by user.
+ */
+enum AVSampleFormat request_sample_fmt;
 } AVCodecContext;
 
 /**
diff --git a/libavcodec/options.c b/libavcodec/options.c
index 9a9ed7b..963f53b 100644
--- a/libavcodec/options.c
+++ b/libavcodec/options.c
@@ -447,6 +447,12 @@ static const AVOption options[]={
 {"em", "Emergency",  0, FF_OPT_TYPE_CONST, AV_AUDIO_SERVICE_TYPE_EMERGENCY, INT_MIN, INT_MAX, A|E, "audio_service_type"},
 {"vo", "Voice Over", 0, FF_OPT_TYPE_CONST, AV_AUDIO_SERVICE_TYPE_VOICE_OVER,INT_MIN, INT_MAX, A|E, "audio_service_type"},
 {"ka", "Karaoke",0, FF_OPT_TYPE_CONST, AV_AUDIO_SERVICE_TYPE_KARAOKE,   INT_MIN, INT_MAX, A|E, "audio_service_type"},
+{"request_sample_fmt", NULL, OFFSET(request_sample_fmt), FF_OPT_TYPE_INT, AV_SAMPLE_FMT_NONE, AV_SAMPLE_FMT_NONE, AV_SAMPLE_FMT_NB-1, A|D, "request_sample_fmt"},
+{"u8" , "8-bit unsigned integer", 0, FF_OPT_TYPE_CONST, AV_SAMPLE_FMT_U8 , INT_MIN, INT_MAX, A|D, "request_sample_fmt"},
+{"s16", "16-bit signed integer",  0, FF_OPT_TYPE_CONST, AV_SAMPLE_FMT_S16, INT_MIN, INT_MAX, A|D, "request_sample_fmt"},
+{"s32", "32-bit signed integer",  0, FF_OPT_TYPE_CONST, AV_SAMPLE_FMT_S32, INT_MIN, INT_MAX, A|D, "request_sample_fmt"},
+{"flt", "32-bit float",   0, FF_OPT_TYPE_CONST, AV_SAMPLE_FMT_FLT, INT_MIN, INT_MAX, A|D, "request_sample_fmt"},
+{"dbl", "64-bit double",  0, FF_OPT_TYPE_CONST, AV_SAMPLE_FMT_DBL, INT_MIN, INT_MAX, A|D, "request_sample_fmt"},
 {NULL},
 };
 
diff --git a/libavcodec/version.h b/libavcodec/version.h
index b9c219d..487e7a5 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -21,7 +21,7 @@
 #define AVCODEC_VERSION_H
 
 #define LIBAVCODEC_VERSION_MAJOR 53
-#define LIBAVCODEC_VERSION_MINOR  0
+#define LIBAVCODEC_VERSION_MINOR  1
 #define LIBAVCODEC_VERSION_MICRO  0
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel