]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/libaomenc.c
avcodec/aacps: Fix integer overflows in hybrid_synthesis()
[ffmpeg] / libavcodec / libaomenc.c
index a2d230399f73eb6ec12c2becab3ba36b286ad14b..7f47707a097ccfa010568ebb4bf9625efcebaa9b 100644 (file)
@@ -575,10 +575,11 @@ static av_cold int aom_init(AVCodecContext *avctx,
         if (enccfg.rc_end_usage == AOM_CQ) {
             enccfg.rc_target_bitrate = 1000000;
         } else {
-            avctx->bit_rate = enccfg.rc_target_bitrate * 1000;
+            enccfg.rc_end_usage = AOM_Q;
+            ctx->crf = 32;
             av_log(avctx, AV_LOG_WARNING,
-                   "Neither bitrate nor constrained quality specified, using default bitrate of %dkbit/sec\n",
-                   enccfg.rc_target_bitrate);
+                   "Neither bitrate nor constrained quality specified, using default CRF of %d\n",
+                   ctx->crf);
         }
     }
 
@@ -728,7 +729,8 @@ static av_cold int aom_init(AVCodecContext *avctx,
     }
 #endif
 #ifdef AOM_CTRL_AV1E_SET_ROW_MT
-    codecctl_int(avctx, AV1E_SET_ROW_MT, ctx->row_mt);
+    if (ctx->row_mt >= 0)
+        codecctl_int(avctx, AV1E_SET_ROW_MT, ctx->row_mt);
 #endif
 #ifdef AOM_CTRL_AV1E_SET_ENABLE_INTRABC
     if (ctx->enable_intrabc >= 0)
@@ -812,7 +814,7 @@ static int storeframe(AVCodecContext *avctx, struct FrameListData *cx_frame,
                       AVPacket *pkt)
 {
     AOMContext *ctx = avctx->priv_data;
-    int pict_type;
+    int av_unused pict_type;
     int ret = ff_alloc_packet2(avctx, pkt, cx_frame->sz, 0);
     if (ret < 0) {
         av_log(avctx, AV_LOG_ERROR,
@@ -1082,15 +1084,15 @@ static const AVOption options[] = {
     { "tiles",            "Tile columns x rows", OFFSET(tile_cols), AV_OPT_TYPE_IMAGE_SIZE, { .str = NULL }, 0, 0, VE },
     { "tile-columns",     "Log2 of number of tile columns to use", OFFSET(tile_cols_log2), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 6, VE},
     { "tile-rows",        "Log2 of number of tile rows to use",    OFFSET(tile_rows_log2), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 6, VE},
-    { "row-mt",           "Enable row based multi-threading",      OFFSET(row_mt),         AV_OPT_TYPE_BOOL, {.i64 = 0},  0, 1, VE},
+    { "row-mt",           "Enable row based multi-threading",      OFFSET(row_mt),         AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE},
     { "enable-cdef",      "Enable CDEF filtering",                 OFFSET(enable_cdef),    AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE},
     { "enable-global-motion",  "Enable global motion",             OFFSET(enable_global_motion), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE},
-    { "enable-intrabc",  "Enable intra block copy prediction mode", OFFSET(enable_intrabc), AV_OPT_TYPE_BOOL, {.i64 = -1},  0, 1, VE},
+    { "enable-intrabc",  "Enable intra block copy prediction mode", OFFSET(enable_intrabc), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE},
     { NULL },
 };
 
 static const AVCodecDefault defaults[] = {
-    { "b",          "256*1000" },
+    { "b",                 "0" },
     { "qmin",             "-1" },
     { "qmax",             "-1" },
     { "g",                "-1" },