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

Christoph Lampert xvid-devel@xvid.org
Tue, 20 Aug 2002 17:04:25 +0200 (CEST)


On Wed, 21 Aug 2002, Radoslaw Czyz wrote:
> 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.

Possible, too. In my method, your way is better, if the chunk is
BBBP'ed, it's unecessary overhead if it's PPPP'ed.  A heuristics may help
to decide whether to use it or not. I didn't mention because I wanted to
keep things as simple as possible. 

> 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_ we talk about max_bframes that large: Use binary search ;-) So check 
xxPxx first! 

> - 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.

In theory, this may be optimal. But it sounds terribly difficult for such 
an infrequent event as a scene change at a B-frames. 
I doubt that happens more often that every 500 frames or so.

The thing is: My idea would give scene-change detection as a by-product of
dynamical b-frame setting. Yours only checks for scene changes. 

Christoph 


-- 
Christoph H. Lampert chl@math,uni-bonn,de | Diese Signature wurde maschi-     
Beringstr. 6, Raum 14 Tel. (0228) 73-2948 | nell erstellt und bedarf
Sprechstunden: keine, aber meistens da    | keiner Unterschrift. AZ 27B-6