[FFmpeg-devel] [PATCH] Multi-Channel Correlation in ALS
Thilo Borgmann
thilo.borgmann
Tue Jan 5 02:04:02 CET 2010
Am 04.01.10 21:50, schrieb Michael Niedermayer:
> On Mon, Jan 04, 2010 at 03:25:06PM +0100, Thilo Borgmann wrote:
>>
>>> ...
>>
>> Missed to include the check for the new reverted_channels field. Patch
>> updated to revision 4.
>>
>> -Thilo
>
> i said its ok but it seems i found a few more minor things
Which means for me to do last changes and apply right away?
>
> [...]
>> @@ -%ld,%ld +%ld,%ld @@
>> }
>>
>>
>> +/** Reads the channel data.
>> + */
>> +static int read_channel_data(ALSDecContext *ctx, ALSChannelData *cd, int c)
>> +{
>> + GetBitContext *gb = &ctx->gb;
>> + ALSChannelData *current = cd;
>> + unsigned int channels = ctx->avctx->channels;
>> + int entries = 0;
>> +
>> + while (entries < channels && !(current->stop_flag = get_bits1(gb))) {
>> + current->master_channel = get_bits_long(gb, av_ceil_log2(channels));
>> +
>> + if (current->master_channel >= channels) {
>> + av_log(ctx->avctx, AV_LOG_ERROR, "Invalid master channel!\n");
>> + return -1;
>> + }
>> +
>> + if (current->master_channel != c) {
>> + current->time_diff_flag = get_bits1(gb);
>> + current->weighting[0] = mcc_weightings[av_clip(decode_rice(gb, 1) + 16, 0, 32)];
>> + current->weighting[1] = mcc_weightings[av_clip(decode_rice(gb, 2) + 14, 0, 32)];
>> + current->weighting[2] = mcc_weightings[av_clip(decode_rice(gb, 1) + 16, 0, 32)];
>> +
>> + if (current->time_diff_flag) {
>> + current->weighting[3] = mcc_weightings[av_clip(decode_rice(gb, 1) + 16, 0, 32)];
>> + current->weighting[4] = mcc_weightings[av_clip(decode_rice(gb, 1) + 16, 0, 32)];
>> + current->weighting[5] = mcc_weightings[av_clip(decode_rice(gb, 1) + 16, 0, 32)];
>> +
>> + current->time_diff_sign = get_bits1(gb);
>> + current->time_diff_index = get_bits(gb, ctx->ltp_lag_length - 3) + 3;
>
>> + if (current->time_diff_sign)
>> + current->time_diff_index = -current->time_diff_index;
>
> unneeded, you can flip the sign in the code that uses it
Looks more complicated IMO but I don't care either way.
The other issues are done. Revision 5 attached.
-Thilo
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: als_mcc.rev5.patch
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100105/8358dc78/attachment.asc>
More information about the ffmpeg-devel
mailing list