diff mbox series

[FFmpeg-devel,2/2] avcodec/dnxhddata: remove invalid trimming of frame size

Message ID 20211031224826.77737-2-onemda@gmail.com
State New
Headers show
Series [FFmpeg-devel,1/2] avcodec/dnxhd_parser: make parser more reliable for smaller VBR frame sizes
Related show

Commit Message

Paul B Mahol Oct. 31, 2021, 10:48 p.m. UTC
Signed-off-by: Paul B Mahol <onemda@gmail.com>
---
 libavcodec/dnxhddata.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/dnxhddata.c b/libavcodec/dnxhddata.c
index 3a69a0f501..b5c66dfe1d 100644
--- a/libavcodec/dnxhddata.c
+++ b/libavcodec/dnxhddata.c
@@ -1099,8 +1099,7 @@  int avpriv_dnxhd_get_hr_frame_size(int cid, int w, int h)
     if (!entry)
         return -1;
 
-    result = ((h + 15) / 16) * ((w + 15) / 16) * (int64_t)entry->packet_scale.num / entry->packet_scale.den;
-    result = (result + 2048) / 4096 * 4096;
+    result = av_rescale(((h + 15) / 16) * ((w + 15) / 16), entry->packet_scale.num, entry->packet_scale.den);
 
     return FFMAX(result, 8192);
 }