[Ffmpeg-devel] Post processing of codecs which require it.

Debabrata Banerjee davatar
Sat Feb 4 01:07:09 CET 2006


Short explanation: I believe that avcodec_decode_video is incomplete

Long explanation: I started out by trying to add a decoding feature to 
MythTV. For a long time now MythTV mpeg-4 playback has not had 
post-processing at all. This results in very nasty macroblocking, even at 
high-bit rates - which were really unnecessary if post-processed correctly. 
It does have it's own filter-plugin mechanism, however only raw frames are 
available to the output filter. Qscale_table and qstride are really 
necessary in order to properly post-process and mpeg-4 frame. There was an 
effort more than a year ago to push these out with each frame into the 
buffer and then into the filter plugins - and it never worked. So I sat down 
and decided to try and fix this, except I wasn't going to bother trying to 
buffer these values, but rather post-process directly after the decoded 
frame was received as it was codec specific -who wants to (or should) 
deblock/dering mpeg2/rtjpeg/HD/etc video?? Having never seen exactly how 
this is done and with little documentation, I noticed there are a lot of 
internal variables that I shouldn't really have to be concerned with or know 
what they do when using ffmpeg as a library. The call should be simple and 
abstract. I believe when you call avcodec_decode_video() to get a frame, 
this frame should be _fully processed_ when you get it back, and the proper 
place to make a code change is not MythTV, but ffmpeg. Right now 
conceptually we are only getting half-decoded frames back, as mpeg-4 
decoding involves a post-processing stage to really be mpeg-4. This applies 
to all the other codecs that need post-processing as well.

What do you guys think?

Also if you disagree - it would be nice to update api_example.c with how to 
do this properly for us n00bs :)

Thanks,
Debabrata 





More information about the ffmpeg-devel mailing list