[FFmpeg-devel,V2,2/2] lavc/hevc_ps: use skip_bits instead of get_bits when skip bits.

Submitted by Jun Zhao on July 12, 2018, 2:28 p.m.

Details

Message ID 1531405724-3952-2-git-send-email-mypopydev@gmail.com
State New
Headers show

Commit Message

Jun Zhao July 12, 2018, 2:28 p.m.
use skip_bits when want to skip some bits.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
---
 libavcodec/hevc_ps.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Michael Niedermayer July 13, 2018, 10:27 a.m.
On Thu, Jul 12, 2018 at 10:28:44PM +0800, Jun Zhao wrote:
> use skip_bits when want to skip some bits.
> 
> Signed-off-by: Jun Zhao <mypopydev@gmail.com>
> ---
>  libavcodec/hevc_ps.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c
> index bc5406b..116d938 100644
> --- a/libavcodec/hevc_ps.c
> +++ b/libavcodec/hevc_ps.c
> @@ -1679,7 +1679,7 @@ int ff_hevc_decode_nal_pps(GetBitContext *gb, AVCodecContext *avctx,
>  
>      if (get_bits1(gb)) { // pps_extension_present_flag
>          int pps_range_extensions_flag = get_bits1(gb);
> -        /* int pps_extension_7bits = */ get_bits(gb, 7);

> +        skip_bits(gb, 7); // pps_extension_7bits = get_bits(gb, 7)

Theres no need to keep "= get_bits(gb, 7)" in the comment i think


[...]
mypopy@gmail.com July 16, 2018, 12:17 a.m.
On Fri, Jul 13, 2018 at 6:28 PM Michael Niedermayer <michael@niedermayer.cc>
wrote:
>
> On Thu, Jul 12, 2018 at 10:28:44PM +0800, Jun Zhao wrote:
> > use skip_bits when want to skip some bits.
> >
> > Signed-off-by: Jun Zhao <mypopydev@gmail.com>
> > ---
> >  libavcodec/hevc_ps.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c
> > index bc5406b..116d938 100644
> > --- a/libavcodec/hevc_ps.c
> > +++ b/libavcodec/hevc_ps.c
> > @@ -1679,7 +1679,7 @@ int ff_hevc_decode_nal_pps(GetBitContext *gb,
AVCodecContext *avctx,
> >
> >      if (get_bits1(gb)) { // pps_extension_present_flag
> >          int pps_range_extensions_flag = get_bits1(gb);
> > -        /* int pps_extension_7bits = */ get_bits(gb, 7);
>
> > +        skip_bits(gb, 7); // pps_extension_7bits = get_bits(gb, 7)
>
> Theres no need to keep "= get_bits(gb, 7)" in the comment i think
>
Change the comment and applied, Thanks
>
> [...]
>
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> Take away the freedom of one citizen and you will be jailed, take away
> the freedom of all citizens and you will be congratulated by your peers
> in Parliament.
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Patch hide | download patch | download mbox

diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c
index bc5406b..116d938 100644
--- a/libavcodec/hevc_ps.c
+++ b/libavcodec/hevc_ps.c
@@ -1679,7 +1679,7 @@  int ff_hevc_decode_nal_pps(GetBitContext *gb, AVCodecContext *avctx,
 
     if (get_bits1(gb)) { // pps_extension_present_flag
         int pps_range_extensions_flag = get_bits1(gb);
-        /* int pps_extension_7bits = */ get_bits(gb, 7);
+        skip_bits(gb, 7); // pps_extension_7bits = get_bits(gb, 7)
         if (sps->ptl.general_ptl.profile_idc == FF_PROFILE_HEVC_REXT && pps_range_extensions_flag) {
             if ((ret = pps_range_extensions(gb, avctx, pps, sps)) < 0)
                 goto err;