[FFmpeg-devel] [PATCH] Split reading and decoding of blocks in ALS

Thilo Borgmann thilo.borgmann
Sun Dec 13 11:54:06 CET 2009


Am 12.12.09 19:08, schrieb Michael Niedermayer:
> On Sat, Dec 12, 2009 at 08:11:51AM +0100, Thilo Borgmann wrote:
>> Am 12.12.09 00:20, schrieb Carl Eugen Hoyos:
>>> Thilo Borgmann <thilo.borgmann <at> googlemail.com> writes:
>>>
>>>> I added a patch for clarification,
>>>
>>> No.
>>
>> Oh, thanks for reminding!
> [...]
>>  /** Reads the block data for a constant block
>>   */
>> -static void read_const_block(ALSDecContext *ctx, int32_t *raw_samples,
>> -                             unsigned int block_length, unsigned int *js_blocks)
>> +static void read_const_block_data(ALSDecContext *ctx, ALSBlockData *bd)
>>  {
>>      ALSSpecificConfig *sconf = &ctx->sconf;
>>      AVCodecContext *avctx    = ctx->avctx;
>>      GetBitContext *gb        = &ctx->gb;
>> -    int32_t const_val        = 0;
>> -    unsigned int const_block, k;
>>  
>> -    const_block  = get_bits1(gb);    // 1 = constant value, 0 = zero block (silence)
>> -    *js_blocks   = get_bits1(gb);
>> +    bd->const_val    = 0;
>> +    bd->const_block  = get_bits1(gb);    // 1 = constant value, 0 = zero block (silence)
>> +    bd->js_blocks    = get_bits1(gb);
>>  
>>      // skip 5 reserved bits
>>      skip_bits(gb, 5);
>>  
>> -    if (const_block) {
>> +    if (bd->const_block) {
>>          unsigned int const_val_bits = sconf->floating ? 24 : avctx->bits_per_raw_sample;
>> -        const_val = get_sbits_long(gb, const_val_bits);
>> +        bd->const_val = get_sbits_long(gb, const_val_bits);
>>      }
>>  
>> +    // ensure constant block decoding by reusing this field
>> +    bd->const_block = 1;
> 
> it seems const_block before this can stay as a local var
> similar, if there are other variables tha can stay local they should
> 
> [...]
>>  
>> -
>>      if (!sconf->rlslms) {
> 
> unrelated
> 
> [...]
>>  }
>>  
>> -
>>  /** Reads the block data.
>>   */
> 
> hmm
> 
> except these the patch should be ok

Corrected all these as well as the issues mentioned in a previous review.

-Thilo
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: als_read_decode.rev1.patch
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20091213/e96d6a12/attachment.txt>



More information about the ffmpeg-devel mailing list