/* 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
}
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);
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");
}
enc->out_buf = pkt->data;
- /* Check for I frame */
+ /* Check for I-frame */
if (enc->framesSinceKeyframe == avctx->gop_size)
enc->framesSinceKeyframe = 0;