From: Wu Jianhua <toqsxw@outlook.com>
To: "ffmpeg-devel@ffmpeg.org" <ffmpeg-devel@ffmpeg.org>
Subject: [FFmpeg-devel] 回复: [PATCH v1 03/19] avcodec/vvc/sei: add decode_film_grain_characteristics
Date: Sat, 26 Apr 2025 10:56:15 +0000
Message-ID: <TYWPR01MB9955582A02A2A8C3D499F739CA872@TYWPR01MB9955.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <GV1P250MB07378BADD120594AA91E8A8D8F842@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM>
Andreas Rheinhardt <andreas.rheinhardt@outlook.com>:
> 发送时间: 2025年4月25日 15:11
> 收件人: ffmpeg-devel@ffmpeg.org <ffmpeg-devel@ffmpeg.org>
> 主题: Re: [FFmpeg-devel] [PATCH v1 03/19] avcodec/vvc/sei: add decode_film_grain_characteristics
>
> toqsxw@gmail.com:
>> From: Wu Jianhua <toqsxw@outlook.com>
>>
>> Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
>> ---
>> libavcodec/vvc/sei.c | 66 ++++++++++++++++++++++++++++++++++++++++++++
>> 1 file changed, 66 insertions(+)
>>
>> diff --git a/libavcodec/vvc/sei.c b/libavcodec/vvc/sei.c
>> index 2842862a36..365f815950 100644
>> --- a/libavcodec/vvc/sei.c
>> +++ b/libavcodec/vvc/sei.c
>> @@ -24,15 +24,81 @@
>> #include "dec.h"
>> #include "libavutil/refstruct.h"
>>
>> +static int decode_film_grain_characteristics(H2645SEIFilmGrainCharacteristics *h, const SEIRawFilmGrainCharacteristics *s, const VVCFrameContext *fc)
>> +{
>> + const VVCSPS *sps = fc->ps.sps;
>> +
>> + h->present = !s->fg_characteristics_cancel_flag;
>> + if (h->present) {
>> + h->model_id = s->fg_model_id;
>> + h->separate_colour_description_present_flag = s->fg_separate_colour_description_present_flag;
>> + if (h->separate_colour_description_present_flag) {
>> + h->bit_depth_luma = s->fg_bit_depth_luma_minus8 + 8;
>> + h->bit_depth_chroma = s->fg_bit_depth_chroma_minus8 + 8;
>> + h->full_range = s->fg_full_range_flag;
>> + h->color_primaries = s->fg_colour_primaries;
>> + h->transfer_characteristics = s->fg_transfer_characteristics;
>> + h->matrix_coeffs = s->fg_matrix_coeffs;
>> + } else {
>> + if (!sps) {
>> + av_log(fc->log_ctx, AV_LOG_ERROR,
>> + "No active SPS for film_grain_characteristics.\n");
>> + return AVERROR_INVALIDDATA;
>> + }
>> + h->bit_depth_luma = sps->bit_depth;
>> + h->bit_depth_chroma = sps->bit_depth;
>> + h->full_range = sps->r->vui.vui_full_range_flag;
>> + h->color_primaries = sps->r->vui.vui_colour_primaries;
>> + h->transfer_characteristics = sps->r->vui.vui_transfer_characteristics;
>> + h->matrix_coeffs = sps->r->vui.vui_matrix_coeffs ;
>> + }
>> +
>> + h->blending_mode_id = s->fg_blending_mode_id;
>> + h->log2_scale_factor = s->fg_log2_scale_factor;
>> +
>> + for (int c = 0; c < 3; c++) {
>> + h->comp_model_present_flag[c] = s->fg_comp_model_present_flag[c];
>> + if (h->comp_model_present_flag[c]) {
>> + h->num_intensity_intervals[c] = s->fg_num_intensity_intervals_minus1[c] + 1;
>> + h->num_model_values[c] = s->fg_num_model_values_minus1[c] + 1;
>> +
>> + if (h->num_model_values[c] > 6)
>> + return AVERROR_INVALIDDATA;
>> +
>> + for (int i = 0; i < h->num_intensity_intervals[c]; i++) {
>> + h->intensity_interval_lower_bound[c][i] = s->fg_intensity_interval_lower_bound[c][i];
>> + h->intensity_interval_upper_bound[c][i] = s->fg_intensity_interval_upper_bound[c][i];
>> + for (int j = 0; j < h->num_model_values[c]; j++)
>> + h->comp_model_value[c][i][j] = s->fg_comp_model_value[c][i][j];
>> + }
>> + }
>> + }
>> +
>> + h->persistence_flag = s->fg_characteristics_persistence_flag;
>> + }
>> +
>> + return 0;
>> +}
>> +
>
> This is a gigantic translation from CBS to h2645_sei. Several of the
> latter patches do likewise. Is it really beneficial to use h2645_sei,
> given that you do not use it for parsing?
>
Hi Andreas,
Yeah. The VVC decoder used the cbs to parse the sei message. The reason why
we need to translate the cbs to h2645 sei is that we want to use ff_h2645_sei_to_frame
to export the side data so the user can use the film grain sei or other sei, the same
as hevc/h264.
Thanks,
Jianhua
_______________________________________________
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".
next prev parent reply other threads:[~2025-04-26 10:56 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-01 17:15 [FFmpeg-devel] [PATCH v1 01/19] avcodec/cbs_sei_syntax_template: add sei message film_grain_characteristics toqsxw
2025-04-01 17:15 ` [FFmpeg-devel] [PATCH v1 02/19] avcodec/vvc: support decoding prefix and suffix nal units toqsxw
2025-04-01 17:16 ` [FFmpeg-devel] [PATCH v1 03/19] avcodec/vvc/sei: add decode_film_grain_characteristics toqsxw
2025-04-25 22:11 ` Andreas Rheinhardt
2025-04-26 10:56 ` Wu Jianhua [this message]
2025-04-01 17:16 ` [FFmpeg-devel] [PATCH v1 04/19] avcodec/vvc/dec: export sei to the frame when the frame starts toqsxw
2025-04-01 17:16 ` [FFmpeg-devel] [PATCH v1 05/19] avcodec/vvc/dec: support applying film grain by the decoder toqsxw
2025-04-01 17:16 ` [FFmpeg-devel] [PATCH v1 06/19] avcodec/vvc/dec: support removing film grain params from side data toqsxw
2025-04-01 17:16 ` [FFmpeg-devel] [PATCH v1 07/19] avcodec/h274: add H274SEIPictureHash struct toqsxw
2025-04-01 17:16 ` [FFmpeg-devel] [PATCH v1 08/19] avcodec/vvc/sei: add decode_decoded_picture_hash toqsxw
2025-04-01 17:16 ` [FFmpeg-devel] [PATCH v1 09/19] avcodec/h274: add ff_h274_hash functions toqsxw
2025-04-25 22:01 ` Andreas Rheinhardt
2025-05-08 18:36 ` [FFmpeg-devel] 回复: " Wu Jianhua
2025-05-24 14:02 ` Nuo Mi
2025-05-31 1:53 ` Nuo Mi
2025-04-01 17:16 ` [FFmpeg-devel] [PATCH v1 10/19] avcodec/vvcdec: verify picture hash toqsxw
2025-04-25 22:02 ` Andreas Rheinhardt
2025-04-01 17:16 ` [FFmpeg-devel] [PATCH v1 11/19] avcodec/cbs_sei_syntax_template: add sei message sei_display_orientation toqsxw
2025-04-25 22:05 ` Andreas Rheinhardt
2025-04-01 17:16 ` [FFmpeg-devel] [PATCH v1 12/19] avcodec/vvc/sei: add decode_display_orientation toqsxw
2025-04-01 17:16 ` [FFmpeg-devel] [PATCH v1 13/19] avcodec/vvc/sei: add decode_content_light_level_info toqsxw
2025-04-01 17:16 ` [FFmpeg-devel] [PATCH v1 14/19] avcodec/cbs_sei_syntax_template: add sei message frame_field_information toqsxw
2025-04-25 22:08 ` Andreas Rheinhardt
2025-04-25 22:12 ` James Almer
2025-04-25 22:55 ` Andreas Rheinhardt
2025-04-25 22:58 ` James Almer
2025-04-25 23:02 ` Andreas Rheinhardt
2025-04-01 17:16 ` [FFmpeg-devel] [PATCH v1 15/19] avcodec/h274: add H274SEIFrameFieldInfo struct toqsxw
2025-04-01 17:16 ` [FFmpeg-devel] [PATCH v1 16/19] avcodec/vvc/sei: add decode_frame_field_info toqsxw
2025-04-01 17:16 ` [FFmpeg-devel] [PATCH v1 17/19] avcodec/vvc: support fields toqsxw
2025-04-01 17:35 ` Andreas Rheinhardt
2025-04-01 18:11 ` [FFmpeg-devel] 回复: " Wu Jianhua
2025-04-23 13:54 ` Nuo Mi
2025-04-01 17:16 ` [FFmpeg-devel] [PATCH v1 18/19] avcodec/vvc/sei: add decode_ambient_viewing_environment toqsxw
2025-04-01 17:16 ` [FFmpeg-devel] [PATCH v1 19/19] avcodec/vvc/sei: add decode_mastering_display_colour_volume toqsxw
2025-04-25 21:37 ` [FFmpeg-devel] [PATCH v1 01/19] avcodec/cbs_sei_syntax_template: add sei message film_grain_characteristics Andreas Rheinhardt
2025-04-26 11:37 ` [FFmpeg-devel] 回复: " Wu Jianhua
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=TYWPR01MB9955582A02A2A8C3D499F739CA872@TYWPR01MB9955.jpnprd01.prod.outlook.com \
--to=toqsxw@outlook.com \
--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