On Mon, May 23, 2011 at 03:26:22AM +0300, Felipe Contreras wrote:
> On Mon, May 23, 2011 at 3:11 AM, Ronald S. Bultje <[email protected]> wrote:
> > On Sun, May 22, 2011 at 8:07 PM, Felipe Contreras
> > <[email protected]> wrote:
> >> On Fri, May 20, 2011 at 4:03 AM, Felipe Contreras
> >> <[email protected]> wrote:
> >>> 2011/5/20 Måns Rullgård <[email protected]>:
> >>>> "Ronald S. Bultje" <[email protected]> writes:
> >>>>> On Thu, May 19, 2011 at 5:39 PM, Felipe Contreras
> >>>>> <[email protected]> wrote:
> >>>>>> Signed-off-by: Felipe Contreras <[email protected]>
> >>>>>> ---
> >>>>>>  libavcodec/h264.c |    3 +++
> >>>>>>  1 files changed, 3 insertions(+), 0 deletions(-)
> >>>>>>
> >>>>>> diff --git a/libavcodec/h264.c b/libavcodec/h264.c
> >>>>>> index 6b262bc..2e04308 100644
> >>>>>> --- a/libavcodec/h264.c
> >>>>>> +++ b/libavcodec/h264.c
> >>>>>> @@ -1914,6 +1914,9 @@ static int decode_slice_header(H264Context *h, 
> >>>>>> H264Context *h0){
> >>>>>>         s->avctx->sample_aspect_ratio= h->sps.sar;
> >>>>>>         av_assert0(s->avctx->sample_aspect_ratio.den);
> >>>>>>
> >>>>>> +        h->s.avctx->coded_width = 16*s->mb_width;
> >>>>>> +        h->s.avctx->coded_height = 16*s->mb_height;
> >>>>>> +
> >>>>>>         if(h->sps.video_signal_type_present_flag){
> >>>>>>             s->avctx->color_range = h->sps.full_range ? 
> >>>>>> AVCOL_RANGE_JPEG : AVCOL_RANGE_MPEG;
> >>>>>>             if(h->sps.colour_description_present_flag){
> >>>>>
> >>>>> Shouldn't avcodec_set_dimensions() set this?
> >>>>
> >>>> The line before the context of this diff looks like this:
> >>>>
> >>>>        avcodec_set_dimensions(s->avctx, s->width, s->height);
> >>>>
> >>>> This sets coded_{width,height} to s->{width,height}.  I don't know how
> >>>> this relates to mb_width and mb_height.
> >>>
> >>> The code is above:
> >>>
> >>>    s->width = 16*s->mb_width - 2*FFMIN(h->sps.crop_right, 7);
> >>>    if(h->sps.frame_mbs_only_flag)
> >>>        s->height= 16*s->mb_height - 2*FFMIN(h->sps.crop_bottom, 7);
> >>>    else
> >>>        s->height= 16*s->mb_height - 4*FFMIN(h->sps.crop_bottom, 7);
> >>>
> >>> So basically one is cropped, the other one isn't.
> >>
> >> So?
> >
> > I suppose this helps in allocating proper image size or so? Patch is
> > probably fine... I basically don't mind either way.
> 
> I have a client app that uses coded_{width,height}, and the
> documentation says the codec should update this:
> 
> * - decoding: Set by user before init if known. Codec should override
> / dynamically change if needed.

Patch queued.

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

Reply via email to