Re[2]: [XviD-devel] scene change detecting in Bframes mode
Christoph Lampert
xvid-devel@xvid.org
Tue, 20 Aug 2002 16:35:07 +0200 (CEST)
On Tue, 20 Aug 2002, peter ross wrote:
> syskin, isn't this simular to what gruel suggested earlier (that is: use me
> for scenedetection). YES its possible, although will require
> some smarting programming.
I suggested ME for B-/P-mode decision. Or did I suggest something
else and didn't notice?
> For each frame we assume its going to be a P-frame ad perform motion
> estimation. After the m.e. we then decide on the frame type
> - I-frame: code the i-frame
> - P-frame: perform motion compensation && code the P-frame (no need to
> perform m.e. since its already done)
> - B-frame: perform additional m.e. and code the b-frame.
I think, this framebased approach will get too complicated! You not only
have to decide on P or B, but also on "how many B till the next P",
because we can't encode using B unless we have the next P.
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).
Otherwise, perform B-frames direct search (only that) relative to
previous and (N+1)th frame. (BBBBP-mode) Save the resulting size,
quality, whatever.
Use a heuristics to decide which was better: PPPPP or BBBBP. Reencode
all (N+1) frames for PPPPP or BBBBP. (B-frame decision)
Both ways should be implemented already (for DX50), but it might be tricky
to combine everything.
The difference between B-frames and P-frames isn't that big such that we
would really lose something by encoding a few Bframes instead of P in some
cases... Keeping track of a "variable max_bframes" would really be a lot
of work.
gruel
--
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