diff mbox series

[FFmpeg-devel,v3,1/6] avcodec/cbs_av1: Add tx mode enum values

Message ID 20230803060132.501741-1-fei.w.wang@intel.com
State New
Headers show
Series [FFmpeg-devel,v3,1/6] avcodec/cbs_av1: Add tx mode enum values | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Wang, Fei W Aug. 3, 2023, 6:01 a.m. UTC
From: Fei Wang <fei.w.wang@intel.com>

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
---
 libavcodec/av1.h                     | 7 +++++++
 libavcodec/cbs_av1_syntax_template.c | 4 ++--
 2 files changed, 9 insertions(+), 2 deletions(-)

Comments

Xiang, Haihao Aug. 7, 2023, 7:51 a.m. UTC | #1
On Do, 2023-08-03 at 14:01 +0800, fei.w.wang-at-intel.com@ffmpeg.org wrote:
> From: Fei Wang <fei.w.wang@intel.com>
> 
> Signed-off-by: Fei Wang <fei.w.wang@intel.com>
> ---
>  libavcodec/av1.h                     | 7 +++++++
>  libavcodec/cbs_av1_syntax_template.c | 4 ++--
>  2 files changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/av1.h b/libavcodec/av1.h
> index 384f7cddc7..8704bc41c1 100644
> --- a/libavcodec/av1.h
> +++ b/libavcodec/av1.h
> @@ -175,6 +175,13 @@ enum {
>      AV1_RESTORE_SWITCHABLE = 3,
>  };
>  
> +// TX mode (section 6.8.21)
> +enum {
> +    AV1_ONLY_4X4        = 0,
> +    AV1_TX_MODE_LARGEST = 1,
> +    AV1_TX_MODE_SELECT  = 2,
> +};
> +
>  // Sequence Headers are actually unbounded because one can use
>  // an arbitrary number of leading zeroes when encoding via uvlc.
>  // The following estimate is based around using the lowest number
> diff --git a/libavcodec/cbs_av1_syntax_template.c
> b/libavcodec/cbs_av1_syntax_template.c
> index a747e17784..3a5cafbfb7 100644
> --- a/libavcodec/cbs_av1_syntax_template.c
> +++ b/libavcodec/cbs_av1_syntax_template.c
> @@ -1028,9 +1028,9 @@ static int FUNC(read_tx_mode)(CodedBitstreamContext
> *ctx, RWContext *rw,
>      int err;
>  
>      if (priv->coded_lossless)
> -        infer(tx_mode, 0);
> +        infer(tx_mode, AV1_ONLY_4X4);
>      else
> -        increment(tx_mode, 1, 2);
> +        increment(tx_mode, AV1_TX_MODE_LARGEST, AV1_TX_MODE_SELECT);
>  
>      return 0;
>  }

This patchset looks good and works well for me. I'll push it in a few days if
there are no comments. 

Thanks
Haihao
diff mbox series

Patch

diff --git a/libavcodec/av1.h b/libavcodec/av1.h
index 384f7cddc7..8704bc41c1 100644
--- a/libavcodec/av1.h
+++ b/libavcodec/av1.h
@@ -175,6 +175,13 @@  enum {
     AV1_RESTORE_SWITCHABLE = 3,
 };
 
+// TX mode (section 6.8.21)
+enum {
+    AV1_ONLY_4X4        = 0,
+    AV1_TX_MODE_LARGEST = 1,
+    AV1_TX_MODE_SELECT  = 2,
+};
+
 // Sequence Headers are actually unbounded because one can use
 // an arbitrary number of leading zeroes when encoding via uvlc.
 // The following estimate is based around using the lowest number
diff --git a/libavcodec/cbs_av1_syntax_template.c b/libavcodec/cbs_av1_syntax_template.c
index a747e17784..3a5cafbfb7 100644
--- a/libavcodec/cbs_av1_syntax_template.c
+++ b/libavcodec/cbs_av1_syntax_template.c
@@ -1028,9 +1028,9 @@  static int FUNC(read_tx_mode)(CodedBitstreamContext *ctx, RWContext *rw,
     int err;
 
     if (priv->coded_lossless)
-        infer(tx_mode, 0);
+        infer(tx_mode, AV1_ONLY_4X4);
     else
-        increment(tx_mode, 1, 2);
+        increment(tx_mode, AV1_TX_MODE_LARGEST, AV1_TX_MODE_SELECT);
 
     return 0;
 }