]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/dnxhddata.c
Merge commit 'a957e9379d11f2982d615f92c30580a57ea8bb40'
[ffmpeg] / libavcodec / dnxhddata.c
index e9dd29ce4c6058de65b48dc0c4178c4bcfb4b744..154be89860d6042bc90692f7faa96d6527e222de 100644 (file)
@@ -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);