summaryrefslogtreecommitdiff
path: root/libavcodec/dnxhddata.c
diff options
context:
space:
mode:
authorJason Stevens <jay@wizardofthenet.com>2018-09-07 22:42:13 -0700
committerCarl Eugen Hoyos <ceffmpeg@gmail.com>2018-09-10 23:15:42 +0200
commit69f1853a2831addd662041ceb2d90df355b0e60a (patch)
treeb83c08a5fbf89c9f28ab5e78235c78420a68bb40 /libavcodec/dnxhddata.c
parentdf05fd3131fd94d01ebeaa58b4c60510961b8be2 (diff)
downloadffmpeg-69f1853a2831addd662041ceb2d90df355b0e60a.tar.gz
libavcodec/dnxhd: change ff_dnxhd_get_hr_frame_size to avpriv_
refactor ff_dnxhd_get_hr_frame_size to avpriv_dnxhd_get_hr_frame_size, to allow cross library usage in libavformat/mxfenc this change makes this function no longer be always inlined. Signed-off-by: Jason Stevens <jay@wizardofthenet.com>
Diffstat (limited to 'libavcodec/dnxhddata.c')
-rw-r--r--libavcodec/dnxhddata.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/libavcodec/dnxhddata.c b/libavcodec/dnxhddata.c
index e9dd29ce4c..154be89860 100644
--- a/libavcodec/dnxhddata.c
+++ b/libavcodec/dnxhddata.c
@@ -1092,6 +1092,19 @@ int avpriv_dnxhd_get_frame_size(int cid)
return ff_dnxhd_cid_table[i].frame_size;
}
+int avpriv_dnxhd_get_hr_frame_size(int cid, int w, int h)
+{
+ int result, i = ff_dnxhd_get_cid_table(cid);
+
+ if (i < 0)
+ return i;
+
+ result = ((h + 15) / 16) * ((w + 15) / 16) * (int64_t)ff_dnxhd_cid_table[i].packet_scale.num / ff_dnxhd_cid_table[i].packet_scale.den;
+ result = (result + 2048) / 4096 * 4096;
+
+ return FFMAX(result, 8192);
+}
+
int avpriv_dnxhd_get_interlaced(int cid)
{
int i = ff_dnxhd_get_cid_table(cid);