X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fdnxhddata.c;h=154be89860d6042bc90692f7faa96d6527e222de;hb=60e7021064ea9e99854c585d452e89f38635480e;hp=e9dd29ce4c6058de65b48dc0c4178c4bcfb4b744;hpb=41cd5af3250ef976f0a48adeb6dbccc9b2683e58;p=ffmpeg diff --git a/libavcodec/dnxhddata.c b/libavcodec/dnxhddata.c index e9dd29ce4c6..154be89860d 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);