#include #include #include #include #include int main() { AVCodecContext ctx; AVFrame *picture; int got_picture_ptr =1; unsigned char buf[4096]; int buf_size=100; int rc; avcodec_init(); avcodec_register_all(); av_register_all(); ctx.flags |= CODEC_FLAG_QP_RD; ctx.flags |= CODEC_FLAG_QSCALE; ctx.flags |= CODEC_FLAG_PASS1; ctx.flags |= CODEC_FLAG_INPUT_PRESERVED; ctx.flags |= CODEC_FLAG_EMU_EDGE; ctx.mb_decision = FF_MB_DECISION_RD; ctx.gop_size = 30; ctx.thread_count = 1; ctx.rc_min_rate = 40000; ctx.rc_max_rate = 55000; ctx.rc_buffer_size = 128000; ctx.bit_rate = 50000; ctx.width = 176; ctx.height=144; memset(picture,0,sizeof(picture)); rc = avcodec_decode_video(&ctx, picture, &got_picture_ptr, buf,sizeof(buf)); return 0; }