diff mbox series

[FFmpeg-devel,1/6] avcodec/internal, avfilter/qp_table: Remove unused FF_QSCALE_TYPEs

Message ID AS1PR01MB9564FC7E4DFDD8D054CA4DDC8F179@AS1PR01MB9564.eurprd01.prod.exchangelabs.com
State Accepted
Commit e142153bd721947c186bc9fe74664d1117265960
Headers show
Series [FFmpeg-devel,1/6] avcodec/internal, avfilter/qp_table: Remove unused FF_QSCALE_TYPEs | expand

Checks

Context Check Description
yinshiyou/commit_msg_loongarch64 warning The first line of the commit message must start with a context terminated by a colon and a space, for example "lavu/opt: " or "doc: ".
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished

Commit Message

Andreas Rheinhardt March 22, 2022, 12:32 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/internal.h  | 2 --
 libavfilter/qp_table.h | 4 ----
 2 files changed, 6 deletions(-)

Comments

Andreas Rheinhardt March 23, 2022, 12:04 p.m. UTC | #1
Andreas Rheinhardt:
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  libavcodec/internal.h  | 2 --
>  libavfilter/qp_table.h | 4 ----
>  2 files changed, 6 deletions(-)
> 
> diff --git a/libavcodec/internal.h b/libavcodec/internal.h
> index badca4c9dd..f9809926b8 100644
> --- a/libavcodec/internal.h
> +++ b/libavcodec/internal.h
> @@ -37,8 +37,6 @@
>  
>  #define FF_QSCALE_TYPE_MPEG1 0
>  #define FF_QSCALE_TYPE_MPEG2 1
> -#define FF_QSCALE_TYPE_H264  2
> -#define FF_QSCALE_TYPE_VP56  3
>  
>  #define FF_SANE_NB_CHANNELS 512U
>  
> diff --git a/libavfilter/qp_table.h b/libavfilter/qp_table.h
> index 4758ee8538..169a7a7fea 100644
> --- a/libavfilter/qp_table.h
> +++ b/libavfilter/qp_table.h
> @@ -33,16 +33,12 @@ int ff_qp_table_extract(AVFrame *frame, int8_t **table, int *table_w, int *table
>  
>  /**
>   * Normalize the qscale factor
> - * FIXME the H264 qscale is a log based scale, mpeg1/2 is not, the code below
> - *       cannot be optimal
>   */
>  static inline int ff_norm_qscale(int qscale, int type)
>  {
>      switch (type) {
>      case FF_QSCALE_TYPE_MPEG1: return qscale;
>      case FF_QSCALE_TYPE_MPEG2: return qscale >> 1;
> -    case FF_QSCALE_TYPE_H264:  return qscale >> 2;
> -    case FF_QSCALE_TYPE_VP56:  return (63 - qscale + 2) >> 2;
>      }
>      return qscale;
>  }

Will apply this patchset tomorrow unless there are objections.

- Andreas
diff mbox series

Patch

diff --git a/libavcodec/internal.h b/libavcodec/internal.h
index badca4c9dd..f9809926b8 100644
--- a/libavcodec/internal.h
+++ b/libavcodec/internal.h
@@ -37,8 +37,6 @@ 
 
 #define FF_QSCALE_TYPE_MPEG1 0
 #define FF_QSCALE_TYPE_MPEG2 1
-#define FF_QSCALE_TYPE_H264  2
-#define FF_QSCALE_TYPE_VP56  3
 
 #define FF_SANE_NB_CHANNELS 512U
 
diff --git a/libavfilter/qp_table.h b/libavfilter/qp_table.h
index 4758ee8538..169a7a7fea 100644
--- a/libavfilter/qp_table.h
+++ b/libavfilter/qp_table.h
@@ -33,16 +33,12 @@  int ff_qp_table_extract(AVFrame *frame, int8_t **table, int *table_w, int *table
 
 /**
  * Normalize the qscale factor
- * FIXME the H264 qscale is a log based scale, mpeg1/2 is not, the code below
- *       cannot be optimal
  */
 static inline int ff_norm_qscale(int qscale, int type)
 {
     switch (type) {
     case FF_QSCALE_TYPE_MPEG1: return qscale;
     case FF_QSCALE_TYPE_MPEG2: return qscale >> 1;
-    case FF_QSCALE_TYPE_H264:  return qscale >> 2;
-    case FF_QSCALE_TYPE_VP56:  return (63 - qscale + 2) >> 2;
     }
     return qscale;
 }