[FFmpeg-devel] [PATCH 1/2] spdifenc: IEC 61937 encapsulation of DTS-HD for HDMI

Måns Rullgård mans
Thu Jan 27 21:07:40 CET 2011


Anssi Hannula <anssi.hannula at iki.fi> writes:

> On 27.01.2011 21:06, M?ns Rullg?rd wrote:
>> Anssi Hannula <anssi.hannula at iki.fi> writes:
>> 
>>> On 27.01.2011 19:50, Justin Ruggles wrote:
>>>> Hi,
>>>
>>> Hi!
>>>
>>>> On 01/21/2011 01:32 PM, Anssi Hannula wrote:
>>>>
>>>>> ---
>>>>>
>>>>> This time the default mode of operation is to passthrough DTS-core only
>>>>> unless the HD mode is explicitely requested by the user via an AVOption.
>>>>>
>>>>> This way we avoid exporting the final bitrate in avctx->bit_rate as I
>>>>> previously planned, as now the caller always specifies the output rate
>>>>> themselves and therefore already knows the output rate (as is the case
>>>>> for other formats as well).
>>>>>
>>>>> An AVOption is used instead of the previously planned muxrate as the
>>>>> usage doesn't exactly match muxrate semantics.
>>>>>
>>>>>  Changelog              |    2 +-
>>>>>  libavformat/avformat.h |    2 +-
>>>>>  libavformat/spdifenc.c |  147 ++++++++++++++++++++++++++++++++++++++++++++++++
>>>>>  3 files changed, 149 insertions(+), 2 deletions(-)
>>>>>
>>>>> +static int spdif_header_dts4(AVFormatContext *s, AVPacket *pkt, int core_size,
>>>>> +                             int sample_rate, int blocks)
>>>>> +{
>>>>> +    IEC61937Context *ctx = s->priv_data;
>>>>> +    const char dtshd_start_code[10] = { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe };
>>>>
>>>>
>>>> dtshd_start_code could be made static.
>>>
>>> Hm, what difference would it make?
>>>
>>> Since it is a constant, the values are retained over calls by definition
>>> even without "static" keyword, and indeed there seems to be no
>>> difference between "const" or "static const" inside a function in output
>>> of gcc.
>> 
>> It does make a difference:
>
> Ah, indeed, there was a typo in my test.
> I'll add "static" to the patch.
>
> But is there any reason to ever not declare const arrays in function
> context as "static const", then?

No.

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list