On Wed, 6 Feb 2013 18:35:03 +0100, Vittorio Giovara 
<[email protected]> wrote:
> Hi, I'm trying to work on bug 378 (
> https://bugzilla.libav.org/show_bug.cgi?id=378) and have the h264 decoder
> correctly interpret at least the right and bottom SPS cropping.
> According to the documentation there coded_width and coded_height that
> represent the bitstream size and width and height that represent the size
> of what should be displayed.
> So, as I got hinted on IRC, it should be possible to apply cropping at the
> end of the decoding stage and so setting avcodeccontext width to
> coded_width - right_cropping (and similarly for height).
> 
> However if I'm to not exactly sure *where* this should be done in libav
> code: if I do that in h264_decode_end() I get a correct size, but the image
> is just stretched, not cropped, while if I put it in decode_slice() I
> either get a corrupt image or just a full size picture or a lot of error
> messages (regarding MB decoding or reinitialization). I've pasted my
> current modifications with the cropping applied in h264_decode_end().
> 
> What I'm doing wrong? Can anyone give me a few more pointers?

Note that AVFrame also contains width and height. Those are set from the
AVCodecContext values at get_buffer() time. Try modifying them as well.

-- 
Anton Khirnov
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to