[libav-devel] [PATCH 2/4] twinvq: support multiple frames per packet

Kostya Shishkov kostya.shishkov at gmail.com
Mon Nov 11 10:47:52 CET 2013


On 8 November 2013 18:07, Vitor Sessak <vitor1001 at gmail.com> wrote:
> Hi
>
>
> On Fri, Nov 8, 2013 at 10:17 AM, Kostya Shishkov
> <kostya.shishkov at gmail.com> wrote:
>>
>> needed for 22kHz at 20kbps modes in MetaSound (and nothing else so far)
>
>
>
>>  /**
>>  * Parameters and tables that are different for each frame type
>>  */
>> @@ -162,7 +164,8 @@ typedef struct TwinVQContext {
>>     // scratch buffers
>>     float *tmp_buf;
>>
>> -    TwinVQFrameData bits;
>> +    int frame_size, frames_per_packet, cur_frame;
>> +    TwinVQFrameData bits[TWINVQ_MAX_FRAMES_PER_PACKET];
>
> Is there any reason why you can not keep a single unpacket data at a
> time? I mean, why cannot you do something like this pseudocode?
>
>     for (i=0; i < subframes_count; i++) {
>        metasound_read_bitstream(ctx, gb); // Unpack one single frame
>        ff_twinvq_decode_frame(ctx, out); // Decode the unpacked frame
>        out += frame_output_size;
>     }

GetBitContext is specific to the decoder (one is little-endian,
another one is not)
so I cannot expose it easily.


More information about the libav-devel mailing list