From: Anton Khirnov <anton@khirnov.net> To: Ffmpeg Devel <ffmpeg-devel@ffmpeg.org> Subject: Re: [FFmpeg-devel] [PATCH 00/72] Implement support for Vulkan multiplane images and video decoding Date: Mon, 20 Feb 2023 18:40:51 +0100 Message-ID: <167691485179.10789.7137291137884326092@lain.khirnov.net> (raw) In-Reply-To: <NOST85t--3-9@lynne.ee> Quoting Lynne (2023-02-17 04:43:50) > From 4645f1fb3249f8249fdebaf9b3edffc848b9af3c Mon Sep 17 00:00:00 2001 > From: Lynne <dev@lynne.ee> > Date: Wed, 14 Dec 2022 00:18:42 +0100 > Subject: [PATCH 17/72] hevc_ps: expose and parse scc range extension fields > > --- > libavcodec/hevc.h | 2 ++ > libavcodec/hevc_ps.c | 63 ++++++++++++++++++++++++++++++++++++++++---- > libavcodec/hevc_ps.h | 26 ++++++++++++++++++ > 3 files changed, 86 insertions(+), 5 deletions(-) > > diff --git a/libavcodec/hevc.h b/libavcodec/hevc.h > index 1804755327..913c7d4e2e 100644 > --- a/libavcodec/hevc.h > +++ b/libavcodec/hevc.h > @@ -154,6 +154,8 @@ enum { > // get near that, though, so set a lower limit here with the maximum > // possible value for 4K video (at most 135 16x16 Ctb rows). > HEVC_MAX_ENTRY_POINT_OFFSETS = HEVC_MAX_TILE_COLUMNS * 135, > + > + HEVC_PREDICTOR_PALETTE_COMP_ENTRIES_LIST_SIZE = 128, > }; > > > diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c > index a740da9f82..b03f59efef 100644 > --- a/libavcodec/hevc_ps.c > +++ b/libavcodec/hevc_ps.c > @@ -856,7 +856,7 @@ int ff_hevc_parse_sps(HEVCSPS *sps, GetBitContext *gb, unsigned int *sps_id, > int ret = 0; > int log2_diff_max_min_transform_block_size; > int bit_depth_chroma, start; > - int i; > + int i, j; > > // Coded parameters > > @@ -1077,9 +1077,12 @@ int ff_hevc_parse_sps(HEVCSPS *sps, GetBitContext *gb, unsigned int *sps_id, > if (sps->vui_present) > decode_vui(gb, avctx, apply_defdispwin, sps); > > - if (get_bits1(gb)) { // sps_extension_flag > + sps->sps_extension_present_flag = get_bits1(gb); > + if (sps->sps_extension_present_flag) { // sps_extension_flag // department of redundancy department called > sps->sps_range_extension_flag = get_bits1(gb); > - skip_bits(gb, 7); //sps_extension_7bits = get_bits(gb, 7); > + skip_bits(gb, 2); > + sps->sps_scc_extension_flag = get_bits1(gb); > + skip_bits(gb, 4); > if (sps->sps_range_extension_flag) { > sps->transform_skip_rotation_enabled_flag = get_bits1(gb); > sps->transform_skip_context_enabled_flag = get_bits1(gb); > @@ -1105,6 +1108,26 @@ int ff_hevc_parse_sps(HEVCSPS *sps, GetBitContext *gb, unsigned int *sps_id, > av_log(avctx, AV_LOG_WARNING, > "cabac_bypass_alignment_enabled_flag not yet implemented\n"); > } > + if (sps->sps_scc_extension_flag) { > + sps->sps_curr_pic_ref_enabled_flag = get_bits1(gb); > + sps->palette_mode_enabled_flag = get_bits1(gb); > + if (sps->palette_mode_enabled_flag) { > + sps->palette_max_size = get_ue_golomb_long(gb); > + sps->delta_palette_max_predictor_size = get_ue_golomb_long(gb); > + > + sps->sps_palette_predictor_initializer_present_flag = get_bits1(gb); > + if (sps->sps_palette_predictor_initializer_present_flag) { > + sps->sps_num_palette_predictor_initializer_minus1 = get_ue_golomb_long(gb); > + for (i = 0; i < (sps->chroma_format_idc ? 3 : 1); i++) { > + for (j = 0; j <= sps->sps_num_palette_predictor_initializer_minus1; j++) > + sps->palette_predictor_initializers[i][j] = get_ue_golomb_long(gb); > + } > + } > + } > + > + sps->motion_vector_resolution_control_idc = get_bits(gb, 2); > + sps->intra_boundary_filtering_disable_flag = get_bits1(gb); > + } > } > if (apply_defdispwin) { > sps->output_window.left_offset += sps->vui.def_disp_win.left_offset; > @@ -1446,7 +1469,7 @@ int ff_hevc_decode_nal_pps(GetBitContext *gb, AVCodecContext *avctx, > HEVCParamSets *ps) > { > HEVCSPS *sps = NULL; > - int i, ret = 0; > + int i, j, ret = 0; > unsigned int pps_id = 0; > ptrdiff_t nal_size; > unsigned log2_parallel_merge_level_minus2; > @@ -1664,11 +1687,41 @@ int ff_hevc_decode_nal_pps(GetBitContext *gb, AVCodecContext *avctx, > pps->pps_extension_present_flag = get_bits1(gb); > if (pps->pps_extension_present_flag) { > pps->pps_range_extensions_flag = get_bits1(gb); > - skip_bits(gb, 7); // pps_extension_7bits > + skip_bits(gb, 2); > + pps->pps_scc_extension_flag = get_bits1(gb); > + skip_bits(gb, 4); > if (sps->ptl.general_ptl.profile_idc == FF_PROFILE_HEVC_REXT && pps->pps_range_extensions_flag) { > if ((ret = pps_range_extensions(gb, avctx, pps, sps)) < 0) > goto err; > } > + if (pps->pps_scc_extension_flag) { > + pps->pps_curr_pic_ref_enabled_flag = get_bits1(gb); > + pps->residual_adaptive_colour_transform_enabled_flag = get_bits1(gb); > + > + if (pps->residual_adaptive_colour_transform_enabled_flag) { > + pps->pps_slice_act_qp_offsets_present_flag = get_bits1(gb); > + pps->pps_act_y_qp_offset_plus5 = get_se_golomb(gb); > + pps->pps_act_cb_qp_offset_plus5 = get_se_golomb(gb); > + pps->pps_act_cr_qp_offset_plus3 = get_se_golomb(gb); > + } > + > + pps->pps_palette_predictor_initializer_present_flag = get_bits1(gb); > + if (pps->pps_palette_predictor_initializer_present_flag) { > + pps->pps_num_palette_predictor_initializer = get_ue_golomb_long(gb); > + if (pps->pps_num_palette_predictor_initializer) { > + pps->monochrome_palette_flag = get_bits1(gb); > + pps->luma_bit_depth_entry_minus8 = get_ue_golomb_long(gb); > + > + if (!pps->monochrome_palette_flag) > + pps->chroma_bit_depth_entry_minus8 = get_ue_golomb_long(gb); > + > + for (i = 0; i < (pps->monochrome_palette_flag ? 1 : 3); i++) { > + for (j = 0; j < pps->pps_num_palette_predictor_initializer; j++) You're allowed to declare loop variables inside loops now. > + pps->palette_predictor_initializers[i][j] = get_ue_golomb_long(gb); > + } > + } > + } > + } > } > > ret = setup_pps(avctx, gb, pps, sps); > diff --git a/libavcodec/hevc_ps.h b/libavcodec/hevc_ps.h > index 549e0bdf57..8dddf7ef8d 100644 > --- a/libavcodec/hevc_ps.h > +++ b/libavcodec/hevc_ps.h > @@ -210,6 +210,18 @@ typedef struct HEVCSPS { > VUI vui; > PTL ptl; > > + int sps_extension_present_flag; > + int sps_scc_extension_flag; > + int sps_curr_pic_ref_enabled_flag; > + int palette_mode_enabled_flag; > + uint8_t palette_max_size; > + uint8_t delta_palette_max_predictor_size; > + uint8_t motion_vector_resolution_control_idc; > + uint8_t sps_num_palette_predictor_initializer_minus1; > + int sps_palette_predictor_initializer_present_flag; > + int intra_boundary_filtering_disable_flag; > + uint16_t palette_predictor_initializers[3][HEVC_PREDICTOR_PALETTE_COMP_ENTRIES_LIST_SIZE]; > + > uint8_t scaling_list_enable_flag; > int scaling_list_data_present_flag; > ScalingList scaling_list; > @@ -341,6 +353,20 @@ typedef struct HEVCPPS { > uint8_t log2_sao_offset_scale_luma; > uint8_t log2_sao_offset_scale_chroma; > > + int pps_scc_extension_flag; > + int pps_curr_pic_ref_enabled_flag; > + int residual_adaptive_colour_transform_enabled_flag; > + int pps_slice_act_qp_offsets_present_flag; > + int pps_palette_predictor_initializer_present_flag; > + int pps_num_palette_predictor_initializer; > + int monochrome_palette_flag; > + int luma_bit_depth_entry_minus8; > + int chroma_bit_depth_entry_minus8; > + int pps_act_y_qp_offset_plus5; > + int pps_act_cb_qp_offset_plus5; > + int pps_act_cr_qp_offset_plus3; All those pps_ and sps_ and prefices are redundant pleonasms and make the code more cluttered. The _plusminus100500 are quite annoying too. -- Anton Khirnov _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
prev parent reply other threads:[~2023-02-20 17:41 UTC|newest] Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-02-17 3:43 Lynne 2023-02-17 9:08 ` Jean-Baptiste Kempf 2023-02-17 9:45 ` Hendrik Leppkes 2023-02-17 10:45 ` Lynne 2023-02-17 11:04 ` Kieran Kunhya [not found] ` <CAK+ULv780c=z_dig_FAhPJ2poZ8u2_QOnnPUmV3SSiYoaQZ+tw@mail.gmail.com-NOU29aV----9> 2023-02-17 11:52 ` Lynne 2023-02-17 15:45 ` Michael Niedermayer 2023-02-17 16:35 ` Lynne 2023-02-18 19:02 ` Michael Niedermayer 2023-02-19 0:08 ` Lynne 2023-02-19 15:40 ` Michael Niedermayer 2023-02-19 15:44 ` Kieran Kunhya 2023-02-19 16:53 ` Lynne 2023-02-19 16:56 ` Jean-Baptiste Kempf 2023-02-19 16:58 ` Lynne 2023-02-19 17:02 ` Jean-Baptiste Kempf 2023-02-19 19:32 ` Niklas Haas 2023-02-19 18:50 ` Michael Niedermayer 2023-02-19 19:02 ` Lynne 2023-02-19 19:44 ` Michael Niedermayer 2023-02-19 20:00 ` Lynne 2023-02-19 20:14 ` Michael Niedermayer [not found] ` <NOea74V--3-9@lynne.ee-NOeaB9K--R-9> 2023-02-19 16:57 ` Lynne 2023-02-19 17:36 ` Kieran Kunhya 2023-02-19 17:42 ` Kieran Kunhya 2023-02-19 18:46 ` Lynne 2023-02-19 21:59 ` Kieran Kunhya 2023-02-19 23:50 ` Neal Gompa 2023-02-20 5:13 ` Jean-Baptiste Kempf 2023-02-20 9:18 ` Hendrik Leppkes 2023-02-20 16:51 ` Anton Khirnov 2023-02-20 16:56 ` Anton Khirnov 2023-02-20 17:21 ` Anton Khirnov 2023-02-20 17:40 ` Anton Khirnov [this message]
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=167691485179.10789.7137291137884326092@lain.khirnov.net \ --to=anton@khirnov.net \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git