[FFmpeg-devel] [PATCH] PB-frames support for i263
Michael Niedermayer
michaelni
Wed Feb 18 12:43:04 CET 2009
On Wed, Feb 18, 2009 at 10:40:56AM +0200, Kostya wrote:
> On Tue, Feb 17, 2009 at 06:48:57PM +0100, Michael Niedermayer wrote:
> > On Tue, Feb 17, 2009 at 08:29:36PM +0200, Kostya wrote:
> [..]
> > > separated
> > > Since i263 are the only codec known (to me) to contain PB-frames, it's the
> > > only way to test code.
> >
> > huh? ITU h263+ allows PB frames, and id be surprised if there are no reference
> > streams around ...
>
> I'd like to find them too.
download tmn and generate your own
>
> [skipping B-part of PB-frame in ff_h263_decode_mb()]
> >
> > the code above that alraedy was there also can be factored out
> > also s->mb_intra = 0; can always be done before and the one afterwards
> > is just restoring the overwritten mode i suspect
>
> It is. The problem is factoring out that code - PB-frame P-part may contain
> both intra- and interblocks, and B-part stuff is dispersed between them
> (i.e. own CBP before P-part CBP, motion vectors after P-part motion vectors,
> own block data after I- or P-block data).
>
> [PB-frame support in I263]
> > i dont think that will compile without the other patch and the other
> > patch will not work without that
> > aka poorly split
>
> What about this patch for better parsing of i263 frame header?
>
> > [...]
> > --
> > Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
> Index: libavcodec/h263.c
> ===================================================================
> --- libavcodec/h263.c (revision 16921)
> +++ libavcodec/h263.c (working copy)
> @@ -6185,17 +6232,54 @@
> return -1; /* SAC: off */
> }
> s->obmc= get_bits1(&s->gb);
> - if (get_bits1(&s->gb) != 0) {
> - av_log(s->avctx, AV_LOG_ERROR, "PB frame mode no supported\n");
> - return -1; /* PB frame mode */
> + s->pb_frame = get_bits1(&s->gb);
> +
> + if(format == 7){
> + format = get_bits(&s->gb, 3);
> + if(format == 0 || format == 7){
> + av_log(s->avctx, AV_LOG_ERROR, "Wrong Intel H263 format\n");
> + return -1;
> + }
> + if(get_bits(&s->gb, 2)){
> + av_log(s->avctx, AV_LOG_ERROR, "Bad value for reserved field\n");
> + return -1;
dont return here, just print an error
> + }
> + s->loop_filter = get_bits1(&s->gb);
> + if(get_bits1(&s->gb)){
> + av_log(s->avctx, AV_LOG_ERROR, "Bad value for reserved field\n");
> + return -1;
dont return here, just print an error
> + }
> + if(get_bits1(&s->gb))
> + s->pb_frame = 2;
> + if(get_bits(&s->gb, 5)){
> + av_log(s->avctx, AV_LOG_ERROR, "Bad value for reserved field\n");
> + return -1;
dont return here, just print an error
> + }
> + if(get_bits(&s->gb, 5) != 1){
> + av_log(s->avctx, AV_LOG_ERROR, "Invalid marker\n");
> + return -1;
dont return here, just print an error
> + }
> }
> + if(format == 6){
> + int ar = get_bits(&s->gb, 4);
> + skip_bits(&s->gb, 9); // display width
> + if(!get_bits1(&s->gb))
> + return -1;
dont return here, just print an error
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
> ... defining _GNU_SOURCE...
For the love of all that is holy, and some that is not, don't do that.
-- Luca & Mans
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090218/77367316/attachment.pgp>
More information about the ffmpeg-devel
mailing list