[Ffmpeg-devel] 3G Video phone encoder behaviour (discussion)

Michael Niedermayer michaelni
Sat Nov 4 13:01:38 CET 2006


Hi

On Sat, Nov 04, 2006 at 08:46:56AM +0100, Tomas Stenlund wrote:
> Hi,
> 
> As I'm sure you are aware of a 3G mobile phone (during
> a video call) have one 64 kbits channel on the CS side
> and for all the terminals I have seen they adopt the
> following strategy:
> 
> 1) During call setup you send an I-frame.
> 
> 2) All of the consecutive frames are P-frames. They never
> send an I-frame again, unless requested (from other terminal
> or maybe loss of radio-link - aka VFU Video Fast Update).
> 
> 3) The encoder cycles the MB:s as INTRA in different
> patterns for the P-frames. Some as a scan line from left
> to right, other from up to down, other in a more random
> pattern.
> 
> So, now to my question. I have tried to look through the source
> code in ffmpeg to see if this encoder behaviour is implemented
> and can be switched on. It does not look like it but I have
> just "skimmed" the source and did not really grasp all.
> 
> Is this possible to do ? If not is this something you have
> discussed of supporting or am I on my own in this case ;-)
> 
> Comments ?

implement the following:
1. have an integer per macroblock, and a refresh_addr variable per
   encoder instance (both in MpegEncContext, first in an array)
2. if a MB is coded as intra set its integer to 0, if its not increase
   it by 1
3. if a MB differs from the previous frame by more then a threshold
   then set its integer to a large value (or increase it by a difference
   dependant value but that would need some extensive testing to determine
   how to select such values)
4. if the macroblock at refresh_addr has a integer > 
   AVCodecContext->intra_refresh_threshold (add this to AVCodecContext)
   then code it as intra
5. increase refresh_addr
6. if the number of macroblocks you forced to intra is < 
   AVCodecContext->max_intra_refresh (add this too) and you havnt reached
   the end of the frame then goto 4
7. if refresh_addr is at the end of the frame set it to 0

and send a patch when your done :)

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is




More information about the ffmpeg-devel mailing list