[FFmpeg-devel,V2,1/2] lavc/hevc_ps: Refine sps_range_extension parse.

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

Details

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

Commit Message

Jun Zhao July 12, 2018, 2:28 p.m.
Signed-off-by: Jun Zhao <mypopydev@gmail.com>
---
 libavcodec/hevc_ps.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

Comments

Michael Niedermayer July 13, 2018, 10:34 a.m.
On Thu, Jul 12, 2018 at 10:28:43PM +0800, Jun Zhao wrote:
> Signed-off-by: Jun Zhao <mypopydev@gmail.com>
> ---
>  libavcodec/hevc_ps.c |    6 ++----
>  1 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c
> index bca3abb..bc5406b 100644
> --- a/libavcodec/hevc_ps.c
> +++ b/libavcodec/hevc_ps.c
> @@ -1094,11 +1094,9 @@ int ff_hevc_parse_sps(HEVCSPS *sps, GetBitContext *gb, unsigned int *sps_id,
>          decode_vui(gb, avctx, apply_defdispwin, sps);
>  
>      if (get_bits1(gb)) { // sps_extension_flag
> -        int sps_extension_flag[1];
> -        for (i = 0; i < 1; i++)
> -            sps_extension_flag[i] = get_bits1(gb);
> +        int sps_range_extension_flag = get_bits1(gb);
>          skip_bits(gb, 7); //sps_extension_7bits = get_bits(gb, 7);
> -        if (sps_extension_flag[0]) {
> +        if (sps_range_extension_flag) {
>              int extended_precision_processing_flag;
>              int cabac_bypass_alignment_enabled_flag;

should be ok i think

[...]
mypopy@gmail.com July 16, 2018, 12:17 a.m.
On Fri, Jul 13, 2018 at 6:34 PM Michael Niedermayer <michael@niedermayer.cc>
wrote:

> On Thu, Jul 12, 2018 at 10:28:43PM +0800, Jun Zhao wrote:
> > Signed-off-by: Jun Zhao <mypopydev@gmail.com>
> > ---
> >  libavcodec/hevc_ps.c |    6 ++----
> >  1 files changed, 2 insertions(+), 4 deletions(-)
> >
> > diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c
> > index bca3abb..bc5406b 100644
> > --- a/libavcodec/hevc_ps.c
> > +++ b/libavcodec/hevc_ps.c
> > @@ -1094,11 +1094,9 @@ int ff_hevc_parse_sps(HEVCSPS *sps, GetBitContext
> *gb, unsigned int *sps_id,
> >          decode_vui(gb, avctx, apply_defdispwin, sps);
> >
> >      if (get_bits1(gb)) { // sps_extension_flag
> > -        int sps_extension_flag[1];
> > -        for (i = 0; i < 1; i++)
> > -            sps_extension_flag[i] = get_bits1(gb);
> > +        int sps_range_extension_flag = get_bits1(gb);
> >          skip_bits(gb, 7); //sps_extension_7bits = get_bits(gb, 7);
> > -        if (sps_extension_flag[0]) {
> > +        if (sps_range_extension_flag) {
> >              int extended_precision_processing_flag;
> >              int cabac_bypass_alignment_enabled_flag;
>
> should be ok i think
>
​Applied, Thanks​


>
> [...]
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> Breaking DRM is a little like attempting to break through a door even
> though the window is wide open and the only thing in the house is a bunch
> of things you dont want and which you would get tomorrow for free anyway
> _______________________________________________
> 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 bca3abb..bc5406b 100644
--- a/libavcodec/hevc_ps.c
+++ b/libavcodec/hevc_ps.c
@@ -1094,11 +1094,9 @@  int ff_hevc_parse_sps(HEVCSPS *sps, GetBitContext *gb, unsigned int *sps_id,
         decode_vui(gb, avctx, apply_defdispwin, sps);
 
     if (get_bits1(gb)) { // sps_extension_flag
-        int sps_extension_flag[1];
-        for (i = 0; i < 1; i++)
-            sps_extension_flag[i] = get_bits1(gb);
+        int sps_range_extension_flag = get_bits1(gb);
         skip_bits(gb, 7); //sps_extension_7bits = get_bits(gb, 7);
-        if (sps_extension_flag[0]) {
+        if (sps_range_extension_flag) {
             int extended_precision_processing_flag;
             int cabac_bypass_alignment_enabled_flag;