]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/qsvenc.c
vp9_metadata: Avoid allocations and copies of packet structures
[ffmpeg] / libavcodec / qsvenc.c
index a03ab69590e9ce3949a7e628f9a2749121cf6562..9bf8574e30326a02fe036243227cc7d38ac4de87 100644 (file)
@@ -577,7 +577,7 @@ static int init_video_param(AVCodecContext *avctx, QSVEncContext *q)
 
     //libmfx BRC parameters are 16 bits thus maybe overflow, then BRCParamMultiplier is needed
     buffer_size_in_kilobytes   = avctx->rc_buffer_size / 8000;
-    initial_delay_in_kilobytes = avctx->rc_initial_buffer_occupancy / 1000;
+    initial_delay_in_kilobytes = avctx->rc_initial_buffer_occupancy / 8000;
     target_bitrate_kbps        = avctx->bit_rate / 1000;
     max_bitrate_kbps           = avctx->rc_max_rate / 1000;
     brc_param_multiplier       = (FFMAX(FFMAX3(target_bitrate_kbps, max_bitrate_kbps, buffer_size_in_kilobytes),
@@ -1307,7 +1307,6 @@ static int encode_frame(AVCodecContext *avctx, QSVEncContext *q,
     if (qsv_frame) {
         surf = &qsv_frame->surface;
         enc_ctrl = &qsv_frame->enc_ctrl;
-        memset(enc_ctrl, 0, sizeof(mfxEncodeCtrl));
 
         if (frame->pict_type == AV_PICTURE_TYPE_I) {
             enc_ctrl->FrameType = MFX_FRAMETYPE_I | MFX_FRAMETYPE_REF;