[FFmpeg-devel] [PATCH] VC1: merge put/add_pixels with IDCT8x8.
Ronald S. Bultje
rsbultje
Sun Feb 20 01:16:41 CET 2011
Hi,
On Sat, Feb 19, 2011 at 12:45 PM, Kostya <kostya.shishkov at gmail.com> wrote:
> On Sat, Feb 19, 2011 at 12:27:16PM -0500, Ronald S. Bultje wrote:
>> Just quick note here:
>>
>> On Sat, Feb 19, 2011 at 12:20 PM, Ronald S. Bultje <rsbultje at gmail.com> wrote:
>> > -static void vc1_put_block(VC1Context *v, DCTELEM block[6][64])
>> [..]
>> > - ? ?if(v->rangeredfrm) {
>> > - ? ? ? ?int i, j, k;
>> > - ? ? ? ?for(k = 0; k < 6; k++)
>> > - ? ? ? ? ? ?for(j = 0; j < 8; j++)
>> > - ? ? ? ? ? ? ? ?for(i = 0; i < 8; i++)
>> > - ? ? ? ? ? ? ? ? ? ?block[k][i + j*8] = (block[k][i + j*8] - 64) << 1;
>> > -
>> > - ? ?}
>> [..]
>> > ?static void vc1_decode_i_blocks(VC1Context *v)
>> [..]
>> > + ? ?idct8x8_fn = v->vc1dsp.vc1_inv_trans_8x8_put[(!!v->rangeredfrm) | ((v->pq < 9 || !v->overlap) << 1)];
>> [..]
>> [..]
>> > - ? ? ? ? ? ? ? ?v->vc1dsp.vc1_inv_trans_8x8(s->block[k]);
>> > - ? ? ? ? ? ? ? ?if(v->pq >= 9 && v->overlap) {
>> > - ? ? ? ? ? ? ? ? ? ?for(j = 0; j < 64; j++) s->block[k][j] += 128;
>> > - ? ? ? ? ? ? ? ?}
>> > + ? ? ? ? ? ? ? ?if(k > 3 && (v->s.flags & CODEC_FLAG_GRAY)) continue;
>> > + ? ? ? ? ? ? ? ?idct8x8_fn(dst[k],
>> > + ? ? ? ? ? ? ? ? ? ? ? ? ? k & 4 ? s->uvlinesize : s->linesize,
>> > + ? ? ? ? ? ? ? ? ? ? ? ? ? s->block[k]);
>> > ? ? ? ? ? ? }
>> >
>> > - ? ? ? ? ? ?vc1_put_block(v, s->block);
>>
>> I know this isn't the same thing. The old code does this:
>>
>> read coeffs
>> do idct
>> if (v->pq >= 9 && v->overlap) add 128 to each of them
>> if (rangered) sub 64 from each of them, <<= 1
>> put_pixels_clamped();
>>
>> the new code does this, essentially:
>> read coeffs
>> do idct
>> if (v->pq >= 9 && v->overlap) add 128 to each of them
>> if (rangered) { if (v->pq >= 9 && v->overlap) { sub 64 from each} <<= 1 }
>> put_pixels_clamped();
>
> That's wrong:
> clause 8.1.1.4 specified range restoration is performed like
> Y[n] = CLIP ((Y[n] ? 128) * 2 + 128)
> when range reduction flag is set at the sequence level
>
> Overlapping (and adding 128) is employed when it's signalled, i.e.
> v->overlap && v->pq >= 9,
> and it's totally independent from range reduction.
Where in the spec do I find this? All I can find is:
"// If a neighboring block is unavailable for prediction, its DC
coefficient is assumed to be the default_predictor
if (OVERLAP == 1 && PQUANT >= 9)
default_predictor = 0; //overlap filtering is on in this case
else
default_predictor = (1024 + (DCStepSize >> 1)) / DCStepSize; //
overlap filtering is off"
Ronald
More information about the ffmpeg-devel
mailing list