Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] lavc/vvc: Increase size of ctb_size_y
@ 2024-04-13 10:55 Frank Plowman
  2024-04-13 13:55 ` James Almer
  0 siblings, 1 reply; 3+ messages in thread
From: Frank Plowman @ 2024-04-13 10:55 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Frank Plowman

sps_log2_ctu_size_minus5 is between 0 and 2, with 3 reserved for future
use.  The VVC decoder allows sps_log2_ctu_size_minus5 to be 3, and so
ctb_size_y should be at least 16 bits to prevent overflows.  An
alternative patch would leave sps_log2_ctu_size_minus5 as 8 bits and
disallow sps_log2_ctu_size_minus5 = 3.

Signed-off-by: Frank Plowman <post@frankplowman.com>
---
 libavcodec/vvc/ps.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/vvc/ps.h b/libavcodec/vvc/ps.h
index 78f1687fef..6656a06320 100644
--- a/libavcodec/vvc/ps.h
+++ b/libavcodec/vvc/ps.h
@@ -69,7 +69,7 @@ typedef struct VVCSPS {
     uint8_t     bit_depth;                                          ///< BitDepth
     uint8_t     qp_bd_offset;                                       ///< QpBdOffset
     uint8_t     ctb_log2_size_y;                                    ///< CtbLog2SizeY
-    uint8_t     ctb_size_y;                                         ///< CtbSizeY
+    uint16_t    ctb_size_y;                                         ///< CtbSizeY
     uint8_t     min_cb_log2_size_y;                                 ///< MinCbLog2SizeY
     uint8_t     min_cb_size_y;                                      ///< MinCbSizeY
     uint8_t     max_tb_size_y;                                      ///< MaxTbSizeY
-- 
2.44.0

_______________________________________________
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] 3+ messages in thread

* Re: [FFmpeg-devel] [PATCH] lavc/vvc: Increase size of ctb_size_y
  2024-04-13 10:55 [FFmpeg-devel] [PATCH] lavc/vvc: Increase size of ctb_size_y Frank Plowman
@ 2024-04-13 13:55 ` James Almer
  2024-04-15 13:08   ` Nuo Mi
  0 siblings, 1 reply; 3+ messages in thread
From: James Almer @ 2024-04-13 13:55 UTC (permalink / raw)
  To: ffmpeg-devel

On 4/13/2024 7:55 AM, Frank Plowman wrote:
> sps_log2_ctu_size_minus5 is between 0 and 2, with 3 reserved for future
> use.  The VVC decoder allows sps_log2_ctu_size_minus5 to be 3, and so
> ctb_size_y should be at least 16 bits to prevent overflows.  An
> alternative patch would leave sps_log2_ctu_size_minus5 as 8 bits and
> disallow sps_log2_ctu_size_minus5 = 3.

The spec says a value of 3 should be ignored, which i assume means 
decoding is not meant to stop. So this patch is probably better than 
outright rejecting the value in CBS.

> 
> Signed-off-by: Frank Plowman <post@frankplowman.com>
> ---
>   libavcodec/vvc/ps.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/vvc/ps.h b/libavcodec/vvc/ps.h
> index 78f1687fef..6656a06320 100644
> --- a/libavcodec/vvc/ps.h
> +++ b/libavcodec/vvc/ps.h
> @@ -69,7 +69,7 @@ typedef struct VVCSPS {
>       uint8_t     bit_depth;                                          ///< BitDepth
>       uint8_t     qp_bd_offset;                                       ///< QpBdOffset
>       uint8_t     ctb_log2_size_y;                                    ///< CtbLog2SizeY
> -    uint8_t     ctb_size_y;                                         ///< CtbSizeY
> +    uint16_t    ctb_size_y;                                         ///< CtbSizeY
>       uint8_t     min_cb_log2_size_y;                                 ///< MinCbLog2SizeY
>       uint8_t     min_cb_size_y;                                      ///< MinCbSizeY
>       uint8_t     max_tb_size_y;                                      ///< MaxTbSizeY
_______________________________________________
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] 3+ messages in thread

* Re: [FFmpeg-devel] [PATCH] lavc/vvc: Increase size of ctb_size_y
  2024-04-13 13:55 ` James Almer
@ 2024-04-15 13:08   ` Nuo Mi
  0 siblings, 0 replies; 3+ messages in thread
From: Nuo Mi @ 2024-04-15 13:08 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

On Sat, Apr 13, 2024 at 9:55 PM James Almer <jamrial@gmail.com> wrote:

> On 4/13/2024 7:55 AM, Frank Plowman wrote:
> > sps_log2_ctu_size_minus5 is between 0 and 2, with 3 reserved for future
> > use.  The VVC decoder allows sps_log2_ctu_size_minus5 to be 3, and so
> > ctb_size_y should be at least 16 bits to prevent overflows.  An
> > alternative patch would leave sps_log2_ctu_size_minus5 as 8 bits and
> > disallow sps_log2_ctu_size_minus5 = 3.
>
> The spec says a value of 3 should be ignored, which i assume means
> decoding is not meant to stop. So this patch is probably better than
> outright rejecting the value in CBS.

Applied.
Thank you, Frank and James.

>
> >
> > Signed-off-by: Frank Plowman <post@frankplowman.com>
> > ---
> >   libavcodec/vvc/ps.h | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libavcodec/vvc/ps.h b/libavcodec/vvc/ps.h
> > index 78f1687fef..6656a06320 100644
> > --- a/libavcodec/vvc/ps.h
> > +++ b/libavcodec/vvc/ps.h
> > @@ -69,7 +69,7 @@ typedef struct VVCSPS {
> >       uint8_t     bit_depth;
> ///< BitDepth
> >       uint8_t     qp_bd_offset;
>  ///< QpBdOffset
> >       uint8_t     ctb_log2_size_y;
> ///< CtbLog2SizeY
> > -    uint8_t     ctb_size_y;
>  ///< CtbSizeY
> > +    uint16_t    ctb_size_y;
>  ///< CtbSizeY
> >       uint8_t     min_cb_log2_size_y;
>  ///< MinCbLog2SizeY
> >       uint8_t     min_cb_size_y;
> ///< MinCbSizeY
> >       uint8_t     max_tb_size_y;
> ///< MaxTbSizeY
> _______________________________________________
> 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".
>
_______________________________________________
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] 3+ messages in thread

end of thread, other threads:[~2024-04-15 13:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-13 10:55 [FFmpeg-devel] [PATCH] lavc/vvc: Increase size of ctb_size_y Frank Plowman
2024-04-13 13:55 ` James Almer
2024-04-15 13:08   ` Nuo Mi

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