* [FFmpeg-devel] [PATCH 1/2] lavc/cbs_h265: Add sps_multilayer_extension support
@ 2023-11-17 13:03 Jun Zhao
2023-11-17 13:03 ` [FFmpeg-devel] [PATCH 2/2] lavc/cbs_h265: Add pps_multilayer_extension support Jun Zhao
2023-11-27 17:59 ` [FFmpeg-devel] [PATCH 1/2] lavc/cbs_h265: Add sps_multilayer_extension support Mark Thompson
0 siblings, 2 replies; 4+ messages in thread
From: Jun Zhao @ 2023-11-17 13:03 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Jun Zhao, Jun Zhao
Add sps_multilayer_extensio support.
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
---
libavcodec/cbs_h265.h | 3 +++
libavcodec/cbs_h265_syntax_template.c | 12 +++++++++++-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/libavcodec/cbs_h265.h b/libavcodec/cbs_h265.h
index 1b1195f198..15951269fd 100644
--- a/libavcodec/cbs_h265.h
+++ b/libavcodec/cbs_h265.h
@@ -330,6 +330,9 @@ typedef struct H265RawSPS {
uint8_t persistent_rice_adaptation_enabled_flag;
uint8_t cabac_bypass_alignment_enabled_flag;
+ // Multilayer extension.
+ uint8_t inter_view_mv_vert_constraint_flag;
+
// Screen content coding extension.
uint8_t sps_curr_pic_ref_enabled_flag;
uint8_t palette_mode_enabled_flag;
diff --git a/libavcodec/cbs_h265_syntax_template.c b/libavcodec/cbs_h265_syntax_template.c
index 2d4b954718..1e3bc1acd8 100644
--- a/libavcodec/cbs_h265_syntax_template.c
+++ b/libavcodec/cbs_h265_syntax_template.c
@@ -717,6 +717,16 @@ static int FUNC(sps_range_extension)(CodedBitstreamContext *ctx, RWContext *rw,
return 0;
}
+static int FUNC(sps_multilayer_extension)(CodedBitstreamContext *ctx, RWContext *rw,
+ H265RawSPS *current)
+{
+ int err;
+
+ flag(inter_view_mv_vert_constraint_flag);
+
+ return 0;
+}
+
static int FUNC(sps_scc_extension)(CodedBitstreamContext *ctx, RWContext *rw,
H265RawSPS *current)
{
@@ -952,7 +962,7 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw,
if (current->sps_range_extension_flag)
CHECK(FUNC(sps_range_extension)(ctx, rw, current));
if (current->sps_multilayer_extension_flag)
- return AVERROR_PATCHWELCOME;
+ CHECK(FUNC(sps_multilayer_extension)(ctx, rw, current));
if (current->sps_3d_extension_flag)
return AVERROR_PATCHWELCOME;
if (current->sps_scc_extension_flag)
--
2.25.1
_______________________________________________
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".
^ permalink raw reply [flat|nested] 4+ messages in thread
* [FFmpeg-devel] [PATCH 2/2] lavc/cbs_h265: Add pps_multilayer_extension support
2023-11-17 13:03 [FFmpeg-devel] [PATCH 1/2] lavc/cbs_h265: Add sps_multilayer_extension support Jun Zhao
@ 2023-11-17 13:03 ` Jun Zhao
2023-11-27 17:59 ` [FFmpeg-devel] [PATCH 1/2] lavc/cbs_h265: Add sps_multilayer_extension support Mark Thompson
1 sibling, 0 replies; 4+ messages in thread
From: Jun Zhao @ 2023-11-17 13:03 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Jun Zhao, Jun Zhao
Add pps_multilayer_extensio support.
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
---
libavcodec/cbs_h265.h | 28 ++++++++++++++++
libavcodec/cbs_h265_syntax_template.c | 48 ++++++++++++++++++++++++++-
2 files changed, 75 insertions(+), 1 deletion(-)
diff --git a/libavcodec/cbs_h265.h b/libavcodec/cbs_h265.h
index 15951269fd..d83dc97072 100644
--- a/libavcodec/cbs_h265.h
+++ b/libavcodec/cbs_h265.h
@@ -421,6 +421,34 @@ typedef struct H265RawPPS {
uint8_t log2_sao_offset_scale_luma;
uint8_t log2_sao_offset_scale_chroma;
+ // Multilayer extension
+ uint8_t poc_reset_info_present_flag;
+ uint8_t pps_infer_scaling_list_flag;
+ uint8_t pps_scaling_list_ref_layer_id;
+ uint8_t num_ref_loc_offsets;
+ uint8_t ref_loc_offset_layer_id[HEVC_MAX_LAYERS];
+
+ uint8_t scaled_ref_layer_offset_present_flag[HEVC_MAX_LAYERS];
+ int16_t scaled_ref_layer_left_offset[HEVC_MAX_LAYERS];
+ int16_t scaled_ref_layer_top_offset[HEVC_MAX_LAYERS];
+ int16_t scaled_ref_layer_right_offset[HEVC_MAX_LAYERS];
+ int16_t scaled_ref_layer_bottom_offset[HEVC_MAX_LAYERS];
+
+ uint8_t ref_region_offset_present_flag[HEVC_MAX_LAYERS];
+ int16_t ref_region_left_offset[HEVC_MAX_LAYERS];
+ int16_t ref_region_top_offset[HEVC_MAX_LAYERS];
+ int16_t ref_region_right_offset[HEVC_MAX_LAYERS];
+ int16_t ref_region_bottom_offset[HEVC_MAX_LAYERS];
+
+ uint8_t resample_phase_set_present_flag[HEVC_MAX_LAYERS];
+ uint8_t phase_hor_luma[HEVC_MAX_LAYERS];
+ uint8_t phase_ver_luma[HEVC_MAX_LAYERS];
+ uint8_t phase_hor_chroma_plus8[HEVC_MAX_LAYERS];
+ uint8_t phase_ver_chroma_plus8[HEVC_MAX_LAYERS];
+
+ uint8_t colour_mapping_enabled_flag;
+ // TODO: colour_mapping_table
+
// Screen content coding extension.
uint8_t pps_curr_pic_ref_enabled_flag;
uint8_t residual_adaptive_colour_transform_enabled_flag;
diff --git a/libavcodec/cbs_h265_syntax_template.c b/libavcodec/cbs_h265_syntax_template.c
index 1e3bc1acd8..de8b838209 100644
--- a/libavcodec/cbs_h265_syntax_template.c
+++ b/libavcodec/cbs_h265_syntax_template.c
@@ -1003,6 +1003,52 @@ static int FUNC(pps_range_extension)(CodedBitstreamContext *ctx, RWContext *rw,
return 0;
}
+static int FUNC(pps_multilayer_extension)(CodedBitstreamContext *ctx, RWContext *rw,
+ H265RawPPS *current)
+{
+ int err, i, index;
+
+ flag(poc_reset_info_present_flag);
+ flag(pps_infer_scaling_list_flag);
+ if (current->pps_infer_scaling_list_flag)
+ ub(6, pps_scaling_list_ref_layer_id);
+ ue(num_ref_loc_offsets, 0, HEVC_MAX_LAYERS);
+
+ for (i=0; i<current->num_ref_loc_offsets; i++) {
+ ub(6, ref_loc_offset_layer_id[i]);
+ index = current->ref_loc_offset_layer_id[i];
+
+ flag(scaled_ref_layer_offset_present_flag[i]);
+ if (current->scaled_ref_layer_offset_present_flag[i]) {
+ se(scaled_ref_layer_left_offset[index], -16383, +16384);
+ se(scaled_ref_layer_top_offset[index], -16383, +16384);
+ se(scaled_ref_layer_right_offset[index], -16383, +16384);
+ se(scaled_ref_layer_bottom_offset[index], -16383, +16384);
+ }
+
+ flag(ref_region_offset_present_flag[i]);
+ if (current->ref_region_offset_present_flag[i]) {
+ se(ref_region_left_offset[index], -16383, +16384);
+ se(ref_region_top_offset[index], -16383, +16384);
+ se(ref_region_right_offset[index], -16383, +16384);
+ se(ref_region_bottom_offset[index], -16383, +16384);
+ }
+
+ flag(resample_phase_set_present_flag[i]);
+ if (current->resample_phase_set_present_flag[i]) {
+ ue(phase_hor_luma[index], 0, 31);
+ ue(phase_ver_luma[index], 0, 31);
+ ue(phase_hor_chroma_plus8[index], 0, 63);
+ ue(phase_ver_chroma_plus8[index], 0, 63);
+ }
+ }
+
+ flag(colour_mapping_enabled_flag);
+ if (current->colour_mapping_enabled_flag)
+ return AVERROR_PATCHWELCOME;
+ return 0;
+}
+
static int FUNC(pps_scc_extension)(CodedBitstreamContext *ctx, RWContext *rw,
H265RawPPS *current)
{
@@ -1153,7 +1199,7 @@ static int FUNC(pps)(CodedBitstreamContext *ctx, RWContext *rw,
if (current->pps_range_extension_flag)
CHECK(FUNC(pps_range_extension)(ctx, rw, current));
if (current->pps_multilayer_extension_flag)
- return AVERROR_PATCHWELCOME;
+ CHECK(FUNC(pps_multilayer_extension)(ctx, rw, current));
if (current->pps_3d_extension_flag)
return AVERROR_PATCHWELCOME;
if (current->pps_scc_extension_flag)
--
2.25.1
_______________________________________________
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".
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [FFmpeg-devel] [PATCH 1/2] lavc/cbs_h265: Add sps_multilayer_extension support
2023-11-17 13:03 [FFmpeg-devel] [PATCH 1/2] lavc/cbs_h265: Add sps_multilayer_extension support Jun Zhao
2023-11-17 13:03 ` [FFmpeg-devel] [PATCH 2/2] lavc/cbs_h265: Add pps_multilayer_extension support Jun Zhao
@ 2023-11-27 17:59 ` Mark Thompson
2023-11-28 2:33 ` mypopy
1 sibling, 1 reply; 4+ messages in thread
From: Mark Thompson @ 2023-11-27 17:59 UTC (permalink / raw)
To: ffmpeg-devel
On 17/11/2023 13:03, Jun Zhao wrote:
> Add sps_multilayer_extensio support.
>
> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
> ---
> libavcodec/cbs_h265.h | 3 +++
> libavcodec/cbs_h265_syntax_template.c | 12 +++++++++++-
> 2 files changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/libavcodec/cbs_h265.h b/libavcodec/cbs_h265.h
> index 1b1195f198..15951269fd 100644
> --- a/libavcodec/cbs_h265.h
> +++ b/libavcodec/cbs_h265.h
> @@ -330,6 +330,9 @@ typedef struct H265RawSPS {
> uint8_t persistent_rice_adaptation_enabled_flag;
> uint8_t cabac_bypass_alignment_enabled_flag;
>
> + // Multilayer extension.
> + uint8_t inter_view_mv_vert_constraint_flag;
> +
> // Screen content coding extension.
> uint8_t sps_curr_pic_ref_enabled_flag;
> uint8_t palette_mode_enabled_flag;
> diff --git a/libavcodec/cbs_h265_syntax_template.c b/libavcodec/cbs_h265_syntax_template.c
> index 2d4b954718..1e3bc1acd8 100644
> --- a/libavcodec/cbs_h265_syntax_template.c
> +++ b/libavcodec/cbs_h265_syntax_template.c
> @@ -717,6 +717,16 @@ static int FUNC(sps_range_extension)(CodedBitstreamContext *ctx, RWContext *rw,
> return 0;
> }
>
> +static int FUNC(sps_multilayer_extension)(CodedBitstreamContext *ctx, RWContext *rw,
> + H265RawSPS *current)
> +{
> + int err;
> +
> + flag(inter_view_mv_vert_constraint_flag);
> +
> + return 0;
> +}
> +
> static int FUNC(sps_scc_extension)(CodedBitstreamContext *ctx, RWContext *rw,
> H265RawSPS *current)
> {
> @@ -952,7 +962,7 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw,
> if (current->sps_range_extension_flag)
> CHECK(FUNC(sps_range_extension)(ctx, rw, current));
> if (current->sps_multilayer_extension_flag)
> - return AVERROR_PATCHWELCOME;
> + CHECK(FUNC(sps_multilayer_extension)(ctx, rw, current));
> if (current->sps_3d_extension_flag)
> return AVERROR_PATCHWELCOME;
> if (current->sps_scc_extension_flag)
This doesn't seem like it it sufficient - when in multilayer the SPS format isn't the same (§F.7.3.2.2.1).
Alternatively: maybe this works for the first layer (haven't verified this but seems plausible), and therefore to work there only it would be sufficient to check if MultiLayerExtSpsFlag is true in an SPS and stop if it is?
(A sample suitable for using with fate would help.)
Thanks,
- Mark
_______________________________________________
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".
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [FFmpeg-devel] [PATCH 1/2] lavc/cbs_h265: Add sps_multilayer_extension support
2023-11-27 17:59 ` [FFmpeg-devel] [PATCH 1/2] lavc/cbs_h265: Add sps_multilayer_extension support Mark Thompson
@ 2023-11-28 2:33 ` mypopy
0 siblings, 0 replies; 4+ messages in thread
From: mypopy @ 2023-11-28 2:33 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Tue, Nov 28, 2023 at 1:59 AM Mark Thompson <sw@jkqxz.net> wrote:
>
> On 17/11/2023 13:03, Jun Zhao wrote:
> > Add sps_multilayer_extensio support.
> >
> > Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
> > ---
> > libavcodec/cbs_h265.h | 3 +++
> > libavcodec/cbs_h265_syntax_template.c | 12 +++++++++++-
> > 2 files changed, 14 insertions(+), 1 deletion(-)
> >
> > diff --git a/libavcodec/cbs_h265.h b/libavcodec/cbs_h265.h
> > index 1b1195f198..15951269fd 100644
> > --- a/libavcodec/cbs_h265.h
> > +++ b/libavcodec/cbs_h265.h
> > @@ -330,6 +330,9 @@ typedef struct H265RawSPS {
> > uint8_t persistent_rice_adaptation_enabled_flag;
> > uint8_t cabac_bypass_alignment_enabled_flag;
> >
> > + // Multilayer extension.
> > + uint8_t inter_view_mv_vert_constraint_flag;
> > +
> > // Screen content coding extension.
> > uint8_t sps_curr_pic_ref_enabled_flag;
> > uint8_t palette_mode_enabled_flag;
> > diff --git a/libavcodec/cbs_h265_syntax_template.c b/libavcodec/cbs_h265_syntax_template.c
> > index 2d4b954718..1e3bc1acd8 100644
> > --- a/libavcodec/cbs_h265_syntax_template.c
> > +++ b/libavcodec/cbs_h265_syntax_template.c
> > @@ -717,6 +717,16 @@ static int FUNC(sps_range_extension)(CodedBitstreamContext *ctx, RWContext *rw,
> > return 0;
> > }
> >
> > +static int FUNC(sps_multilayer_extension)(CodedBitstreamContext *ctx, RWContext *rw,
> > + H265RawSPS *current)
> > +{
> > + int err;
> > +
> > + flag(inter_view_mv_vert_constraint_flag);
> > +
> > + return 0;
> > +}
> > +
> > static int FUNC(sps_scc_extension)(CodedBitstreamContext *ctx, RWContext *rw,
> > H265RawSPS *current)
> > {
> > @@ -952,7 +962,7 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw,
> > if (current->sps_range_extension_flag)
> > CHECK(FUNC(sps_range_extension)(ctx, rw, current));
> > if (current->sps_multilayer_extension_flag)
> > - return AVERROR_PATCHWELCOME;
> > + CHECK(FUNC(sps_multilayer_extension)(ctx, rw, current));
> > if (current->sps_3d_extension_flag)
> > return AVERROR_PATCHWELCOME;
> > if (current->sps_scc_extension_flag)
>
> This doesn't seem like it it sufficient - when in multilayer the SPS format isn't the same (§F.7.3.2.2.1).
>
> Alternatively: maybe this works for the first layer (haven't verified this but seems plausible), and therefore to work there only it would be sufficient to check if MultiLayerExtSpsFlag is true in an SPS and stop if it is?
>
Actually, this case is from MV-HEVC, and I didn't find any other real
examples like the Spec above
> (A sample suitable for using with fate would help.)
>
Will add a new MV-HEVC fate test case
> Thanks,
>
> - Mark
_______________________________________________
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".
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-11-28 2:34 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-17 13:03 [FFmpeg-devel] [PATCH 1/2] lavc/cbs_h265: Add sps_multilayer_extension support Jun Zhao
2023-11-17 13:03 ` [FFmpeg-devel] [PATCH 2/2] lavc/cbs_h265: Add pps_multilayer_extension support Jun Zhao
2023-11-27 17:59 ` [FFmpeg-devel] [PATCH 1/2] lavc/cbs_h265: Add sps_multilayer_extension support Mark Thompson
2023-11-28 2:33 ` mypopy
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