[Ffmpeg-devel] H263 codec performance on ARM

Vadim Lebedev vadim
Tue Mar 13 19:21:05 CET 2007


Hello,

I'm trying to use  latest (SVN) libavcodec  on 180MHZ ARM920  processor 
to encode to H263.

I've a strange problem that  when i'm using ffmpeg utility to encode raw 
yuv qcif video file
i'm getting decent  performance of 30 fps....

But when i'm  doing  encoding in  my code  it   falls to   0.5  fps....

The same code with libavcodec V51.0.0 has no performance problems but 
generate garbage h263 stream on ARM while working well on X86.

The svn version V51.38.0  generates good data but is very slow...


Any ideas what i'm doing wrong?


This is my intialization code:
============================
    pFFmpeg->codec = avcodec_find_encoder(CODEC_ID_H263);
    if (!pFFmpeg->codec)
    {
    fprintf(stderr, "codec not found\n");
    return -1;
    }

    pFFmpeg->c = avcodec_alloc_context();

    // put sample parameters
    pFFmpeg->c->bit_rate = 400000;
    // resolution must be a multiple of two
    pFFmpeg->c->width = 176; 
    pFFmpeg->c->height = 144;
        pFFmpeg->c->pix_fmt = PIX_FMT_YUV420P;
    pFFmpeg->encode_fmt = PIX_FMT_YUV420P;

    pFFmpeg->c->qcompress = 0.0;
    pFFmpeg->c->qblur = 0.0;
    pFFmpeg->c->gop_size = 20;  //or 1
    pFFmpeg->c->sub_id = 1;
    pFFmpeg->c->workaround_bugs = FF_BUG_AUTODETECT;

    //pFFmpeg->c->time_base = (AVRational){1,25};
    pFFmpeg->c->time_base.num = 1;
    pFFmpeg->c->time_base.den = 10;
    pFFmpeg->c->max_b_frames = 0; //pas de B frame en H263

    pFFmpeg->c->opaque = opaque;
    pFFmpeg->c->dct_algo = FF_DCT_AUTO;
    pFFmpeg->c->idct_algo = FF_IDCT_AUTO;
    pFFmpeg->c->rtp_mode = 0;
    pFFmpeg->c->rtp_payload_size = 1000;
    pFFmpeg->c->rtp_callback = 0; // ffmpeg_rtp_callback;


    pFFmpeg->c->flags |= CODEC_FLAG_QSCALE;
    pFFmpeg->c->mb_decision = FF_MB_DECISION_RD;
    pFFmpeg->c->thread_count = 1;
#define DEFAULT_RATE    (16 * 8 * 1024)
    pFFmpeg->c->rc_min_rate = DEFAULT_RATE;
    pFFmpeg->c->rc_max_rate = DEFAULT_RATE;
    pFFmpeg->c->rc_buffer_size = DEFAULT_RATE * 64;
    pFFmpeg->c->bit_rate = DEFAULT_RATE;


    if (avcodec_open(pFFmpeg->c,pFFmpeg->codec)<0)
    {
        fprintf(stderr, "could not open codec\n");
        return -1;
    }
    else printf("\tinit ffmpeg ok, opened codec: h263\n");





Thanks
Vadim




More information about the ffmpeg-devel mailing list