diff mbox series

[FFmpeg-devel,v3,5/5] avcodec/libdavs2: use frame rate code table

Message ID tencent_929F62AB194EFC70572DD99ADA40529A4808@qq.com
State Accepted
Commit a5931f58f767da1adbc1ba79ae068a76dc5d8145
Headers show
Series [FFmpeg-devel,v3,1/5] avcodec/avs2: add AVS2 related definitions | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_armv7_RPi4 success Make finished
andriy/make_fate_armv7_RPi4 success Make fate finished

Commit Message

zhilizhao(赵志立) June 13, 2022, 3:36 a.m. UTC
It's more natural than the floating to fraction conversion.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
---
 libavcodec/libdavs2.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavcodec/libdavs2.c b/libavcodec/libdavs2.c
index bc31745a4f..d7625718a2 100644
--- a/libavcodec/libdavs2.c
+++ b/libavcodec/libdavs2.c
@@ -25,6 +25,7 @@ 
 #include "libavutil/cpu.h"
 #include "avcodec.h"
 #include "codec_internal.h"
+#include "avs2.h"
 #include "davs2.h"
 
 typedef struct DAVS2Context {
@@ -85,7 +86,8 @@  static int davs2_dump_frames(AVCodecContext *avctx, davs2_picture_t *pic, int *g
          */
         avctx->has_b_frames = FFMAX(avctx->has_b_frames, !headerset->low_delay);
 
-        avctx->framerate = av_d2q(headerset->frame_rate,4096);
+        if (headerset->frame_rate_id < 16)
+            avctx->framerate = ff_avs2_frame_rate_tab[headerset->frame_rate_id];
         *got_frame = 0;
         return 0;
     }