diff mbox series

[FFmpeg-devel] lavc/hevc_parser: remove repeated profile/level settings

Message ID 20210130063714.1121442-1-linjie.justin.fu@gmail.com
State New
Headers show
Series [FFmpeg-devel] lavc/hevc_parser: remove repeated profile/level settings | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Linjie Fu Jan. 30, 2021, 6:37 a.m. UTC
Since avctx->profile/level would be set in export_stream_params()
in set_sps(), identical codes here seem to be redundant.

Signed-off-by: Linjie Fu <linjie.justin.fu@gmail.com>
---
 libavcodec/hevc_parser.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Hendrik Leppkes Jan. 30, 2021, 9:56 a.m. UTC | #1
On Sat, Jan 30, 2021 at 7:58 AM Linjie Fu <linjie.justin.fu@gmail.com> wrote:
>
> Since avctx->profile/level would be set in export_stream_params()
> in set_sps(), identical codes here seem to be redundant.
>
> Signed-off-by: Linjie Fu <linjie.justin.fu@gmail.com>
> ---
>  libavcodec/hevc_parser.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/libavcodec/hevc_parser.c b/libavcodec/hevc_parser.c
> index 463d352055..0eb7fb074c 100644
> --- a/libavcodec/hevc_parser.c
> +++ b/libavcodec/hevc_parser.c
> @@ -95,8 +95,6 @@ static int hevc_parse_slice_header(AVCodecParserContext *s, H2645NAL *nal,
>      s->width        = ps->sps->width  - ow->left_offset - ow->right_offset;
>      s->height       = ps->sps->height - ow->top_offset  - ow->bottom_offset;
>      s->format       = ps->sps->pix_fmt;
> -    avctx->profile  = ps->sps->ptl.general_ptl.profile_idc;
> -    avctx->level    = ps->sps->ptl.general_ptl.level_idc;
>
>      if (ps->vps->vps_timing_info_present_flag) {
>          num = ps->vps->vps_num_units_in_tick;

This is in the parser, not the decoder, an independent component, and
the parser does not export this information through other means, this
without it, it would be exporting less information then it does now.
Please leave this in. :)

- Hendrik
diff mbox series

Patch

diff --git a/libavcodec/hevc_parser.c b/libavcodec/hevc_parser.c
index 463d352055..0eb7fb074c 100644
--- a/libavcodec/hevc_parser.c
+++ b/libavcodec/hevc_parser.c
@@ -95,8 +95,6 @@  static int hevc_parse_slice_header(AVCodecParserContext *s, H2645NAL *nal,
     s->width        = ps->sps->width  - ow->left_offset - ow->right_offset;
     s->height       = ps->sps->height - ow->top_offset  - ow->bottom_offset;
     s->format       = ps->sps->pix_fmt;
-    avctx->profile  = ps->sps->ptl.general_ptl.profile_idc;
-    avctx->level    = ps->sps->ptl.general_ptl.level_idc;
 
     if (ps->vps->vps_timing_info_present_flag) {
         num = ps->vps->vps_num_units_in_tick;