[theora] Encode question

Mircea Gliga mgliga at integrasoft.ro
Wed Dec 2 23:22:21 PST 2009


Hello I have a problem encoding a buffer: when I call 
th_encode_ycbcr_in( (th_enc_ctx*)m_encoderHandler, ycbcr); I get
this message in VS: Run-Time Check Failure #3 - The variable 'sb_full' 
is being used without being initialized.
If I hit continue I get the same error but with this variable: 'best_bits'.
When I initialize the encoder I don't get any error.
Initialization:

    ogg_packet    op;
    th_enc_ctx    *td;
    th_comment    tc;
    th_info        theoraInfo;
    th_info_init(&theoraInfo);
    theoraInfo.frame_width = m_codecFrameWidth;
    theoraInfo.frame_height = m_codecFrameHeight;
    theoraInfo.pic_width = pic_w;
    theoraInfo.pic_height = pic_h;
    theoraInfo.pic_x = pic_x;
    theoraInfo.pic_y = pic_y;
    theoraInfo.fps_numerator = m_frame_rate;
    theoraInfo.fps_denominator = 1;
    theoraInfo.aspect_numerator = m_encoderWidth;
    theoraInfo.aspect_denominator = m_encoderHeight;
    theoraInfo.colorspace = TH_CS_UNSPECIFIED;
    theoraInfo.target_bitrate=0;//(int)(100000);
    theoraInfo.quality = 30;// m_quality;
    /* Maximum key frame interval */
    if( m_max_key_interval > 0 )
        theoraInfo.keyframe_granule_shift = ilog(64-1);
    theoraInfo.pixel_fmt = TH_PF_444;
    td = th_encode_alloc( &theoraInfo );
    th_info_clear( &theoraInfo );
    th_comment_init(&tc);
   
    /* create the remaining theora headers */
    for(;;)
    {
        int ret = th_encode_flushheader(td,&tc,&op);
        if(ret<0)
            return false;
        else if(0==ret)
            break;
    }
    m_encoderHandler = td;




-- 
Mircea Gliga



More information about the theora mailing list