[FFmpeg-devel] Using dsp.fdct()

Ramiro Polla ramiro
Sat Apr 19 15:31:45 CEST 2008

Michael Niedermayer wrote:
> On Sat, Apr 19, 2008 at 03:25:44AM +0100, Ramiro Polla wrote:
>> Hello,
>> While writing the mimic decoder, iive taught me that to use 
>> dsp.idct_xxx() functions, I had to create a scantable such as:
>> init() {
>>      ff_init_scantable(ctx->dsp.idct_permutation, &ctx->table, zig_zag);
>> }
>> decode() {
>>      while(coeffs)
>>          block[ctx->table.permutated[pos]] = coeff;
>>      ctx->dsp.idct(block);
>> }
>> Now, with dsp.fdct(), do I also have to use a scantable?
> I think not but its late and iam tired so who knows :)

This leaves me almost at the same spot I was before asking. I'll run 
some tests later on to see...

> But you do have to permute between fdct and idct if you run a idct over
> the output. (hint: ff_block_permute())
> PS: yes you do need to run a idct over it if you want to use it as reference
> frame otherwise decoder and encoder will have different reference frames.

And this leaves me in a spot where I have more doubts than before asking =)
The current code compares both frames with their original content (well, 
besides that luma plane pre-processing, but I'm not sure how long I'll 
keep that). I imagine this scenario where copying the idct over the 
original content could be worse (untested, but sounds like a good scenario):
If I have a low quality encoding, the idct output will have lots of 
differences from the original content. If I compare the current frame's 
content with the idct output from the previous one, the differences 
might be higher than the threshold, so it will encode the new image, 
when it could have just used the previous one instead.

> Ohh and thanks for working on a mimic encoder .. i do guess correct dont i? :)

Well, it's getting FFmpegable... =)

Ramiro Polla

More information about the ffmpeg-devel mailing list