]> git.sesse.net Git - ffmpeg/commitdiff
libavcodec/dnxhd: change ff_dnxhd_get_hr_frame_size to avpriv_
authorJason Stevens <jay@wizardofthenet.com>
Sat, 8 Sep 2018 05:42:13 +0000 (22:42 -0700)
committerCarl Eugen Hoyos <ceffmpeg@gmail.com>
Mon, 10 Sep 2018 21:15:42 +0000 (23:15 +0200)
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>
libavcodec/dnxhd_parser.c
libavcodec/dnxhddata.c
libavcodec/dnxhddata.h
libavcodec/dnxhdenc.c

index 79ca1d6718845ffaab35bbf806f78795013c5510..7c16e251a493785cc549126c39ddca5ba95d6c6e 100644 (file)
@@ -75,7 +75,7 @@ static int dnxhd_find_frame_end(DNXHDParserContext *dctx,
 
                 remaining = avpriv_dnxhd_get_frame_size(cid);
                 if (remaining <= 0) {
-                    remaining = ff_dnxhd_get_hr_frame_size(cid, dctx->w, dctx->h);
+                    remaining = avpriv_dnxhd_get_hr_frame_size(cid, dctx->w, dctx->h);
                     if (remaining <= 0)
                         continue;
                 }
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);
index f80ce18f3c43db0da51ff599fb6610128df41320..cfa6b0c99d6d4b054c1d714fd19b934205591f0f 100644 (file)
@@ -90,20 +90,8 @@ static av_always_inline uint64_t ff_dnxhd_parse_header_prefix(const uint8_t *buf
     return ff_dnxhd_check_header_prefix(prefix);
 }
 
-static av_always_inline int ff_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_frame_size(int cid);
+int avpriv_dnxhd_get_hr_frame_size(int cid, int w, int h);
 int avpriv_dnxhd_get_interlaced(int cid);
 
 #endif /* AVCODEC_DNXHDDATA_H */
index 9325f38baf212b8215a52481b35d364b37cb90de..41b8079a09ca9ba6176b4e2df0db48318d84c0ee 100644 (file)
@@ -482,7 +482,7 @@ static av_cold int dnxhd_encode_init(AVCodecContext *avctx)
     ctx->m.mb_num = ctx->m.mb_height * ctx->m.mb_width;
 
     if (ctx->cid_table->frame_size == DNXHD_VARIABLE) {
-        ctx->frame_size = ff_dnxhd_get_hr_frame_size(ctx->cid,
+        ctx->frame_size = avpriv_dnxhd_get_hr_frame_size(ctx->cid,
                                                      avctx->width, avctx->height);
         av_assert0(ctx->frame_size >= 0);
         ctx->coding_unit_size = ctx->frame_size;