Re[4]: [XviD-devel] scene change detecting in Bframes mode

Radoslaw Czyz xvid-devel@xvid.org
Wed, 21 Aug 2002 00:17:32 +0930


> I'd rather say, make it in chunks of fixed size:
> Take N+1 frames for max_bframes=N (the usual read-ahead).  Perform fast
> simple non-halfpel Pframes' ME for every one of them, always relative to
> the previous frame (PPPPP mode). Perform "normal" P-frame ME on the
> last. If any of those becomes an I-frame, encode all the frames as P or I,
> without any B-VOPs (that's the scene-change detector).

How about:
- take N+1 frames.
- do a P-ME (full) on the last frame only. You have something like
  xxxxP now
- if the last frame is really P, then there was no scene change in the
frames so you can encode the rest of the frames as B. The end.

However, if there was a scene change somewhere, THEN you have to
find where it was:
- you move one frame back. You have xxxPx
- if the 'P' is still I, go back: xxPxx
- I again - xPxxx. Now, it turns out that the P is a perfect P with
little number of intra blocks. You have ME ready, encode it: xPxxx
- the frames before - they are B: BPxxx
- the first frame of new scene  - I. BPIxx
- now, you can either finish the block: BPIBP and take new N+1 frames,
or write only the BPI part and get more frames until you have N+1 in
the buffer again.





CL> Otherwise, perform B-frames direct search (only that) relative to
CL> previous and (N+1)th frame. (BBBBP-mode) Save the resulting size,
CL> quality, whatever.

CL> Use a heuristics to decide which was better: PPPPP or BBBBP. Reencode 
CL> all (N+1) frames for PPPPP or BBBBP. (B-frame decision)

CL> Both ways should be implemented already (for DX50), but it might be tricky
CL> to combine everything.

CL> The difference between B-frames and P-frames isn't that big such that we
CL> would really lose something by encoding a few Bframes instead of P in some
CL> cases... Keeping track of a "variable max_bframes" would really be a lot
CL> of work.

CL> gruel






-- 
Best regards,
 Radoslaw                            mailto:syskin@bigpond.com