]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/roqvideoenc.c
cbs: Add an explicit type for coded bitstream unit types
[ffmpeg] / libavcodec / roqvideoenc.c
index fd651e9552607c47ef4ba181e28e2cbde4b69016..6421ccc8561363bd0beb270d6d9b92b665480444 100644 (file)
@@ -735,21 +735,6 @@ static void reconstruct_and_encode_image(RoqContext *enc, RoqTempdata *tempData,
     /* Flush the remainder of the argument/type spool */
     while (spool.typeSpoolLength)
         write_typecode(&spool, 0x0);
-
-#if 0
-    uint8_t *fdata[3] = {enc->frame_to_enc->data[0],
-                           enc->frame_to_enc->data[1],
-                           enc->frame_to_enc->data[2]};
-    uint8_t *cdata[3] = {enc->current_frame->data[0],
-                           enc->current_frame->data[1],
-                           enc->current_frame->data[2]};
-    av_log(enc->avctx, AV_LOG_ERROR, "Expected distortion: %i Actual: %i\n",
-           dist,
-           block_sse(fdata, cdata, 0, 0, 0, 0,
-                     enc->frame_to_enc->linesize,
-                     enc->current_frame->linesize,
-                     enc->width));  //WARNING: Square dimensions implied...
-#endif
 }
 
 
@@ -955,8 +940,6 @@ static int roq_encode_video(RoqContext *enc)
     reconstruct_and_encode_image(enc, tempData, enc->width, enc->height,
                                  enc->width*enc->height/64);
 
-    enc->avctx->coded_frame = enc->current_frame;
-
     /* Rotate frame history */
     FFSWAP(AVFrame *, enc->current_frame, enc->last_frame);
     FFSWAP(motion_vect *, enc->last_motion4, enc->this_motion4);
@@ -992,6 +975,8 @@ static av_cold int roq_encode_init(AVCodecContext *avctx)
 
     av_lfg_init(&enc->randctx, 1);
 
+    enc->avctx = avctx;
+
     enc->framesSinceKeyframe = 0;
     if ((avctx->width & 0xf) || (avctx->height & 0xf)) {
         av_log(avctx, AV_LOG_ERROR, "Dimensions must be divisible by 16\n");
@@ -1080,7 +1065,7 @@ static int roq_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     }
     enc->out_buf = pkt->data;
 
-    /* Check for I frame */
+    /* Check for I-frame */
     if (enc->framesSinceKeyframe == avctx->gop_size)
         enc->framesSinceKeyframe = 0;