[FFmpeg-devel] [PATCH v2 1/2] avcodec/videotoolbox: use AV_WB16 where possible

wm4 nfxjfg at googlemail.com
Thu Sep 28 02:13:02 EEST 2017


On Wed, 27 Sep 2017 19:45:23 -0300
James Almer <jamrial at gmail.com> wrote:

> On 9/27/2017 7:19 PM, Aman Gupta wrote:
> > From: Aman Gupta <aman at tmm1.net>
> > 
> > additional changes to hevc patchset, as suggested on-list
> > 
> > if these look fine, I will squash into previous patchset and push it to
> > master.
> > ---
> >  libavcodec/videotoolbox.c | 27 +++++++++------------------
> >  1 file changed, 9 insertions(+), 18 deletions(-)
> > 
> > diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c
> > index 078174cc61..c96200cbdb 100644
> > --- a/libavcodec/videotoolbox.c
> > +++ b/libavcodec/videotoolbox.c
> > @@ -165,10 +165,8 @@ CFDataRef ff_videotoolbox_hvcc_extradata_create(AVCodecContext *avctx)
> >                   ptlc.non_packed_constraint_flag << 5 |
> >                   ptlc.frame_only_constraint_flag << 4);
> >      AV_W8(p + 7, 0);
> > -    AV_W8(p + 8, 0);
> > -    AV_W8(p + 9, 0);
> > -    AV_W8(p + 10, 0);
> > -    AV_W8(p + 11, 0);
> > +    AV_WB16(p + 8, 0);
> > +    AV_WB16(p + 10, 0);  
> 
> AV_WB32(p + 8, 0)
> 
> or even AV_WN32(p + 8, 0) since it's 0 and endianness doesn't matter.

IMO it should reflect whatever bitstream elements these are. Ideally,
we'd have comments about what each element is too.


More information about the ffmpeg-devel mailing list