[FFmpeg-devel] [PATCH]Add Dirac support to ffmpeg via libdirac_* and Schroedinger libraries]

Anuradha Suraparaju anuradha
Wed Apr 9 04:44:29 CEST 2008


On Sat, 2008-04-05 at 01:44 +0200, Michael Niedermayer wrote:


> [...]

> > +                
> > +            /* set output data */
> > +            p_frame_output->p_data=(unsigned char*)av_malloc(p_dirac_params->p_encoder->enc_buf.size);
> > +            memcpy(p_frame_output->p_data,p_dirac_params->p_encoder->enc_buf.buffer,p_dirac_params->p_encoder->enc_buf.size);
> > +            p_frame_output->size=p_dirac_params->p_encoder->enc_buf.size;
> > +            p_frame_output->type=p_dirac_params->p_encoder->enc_pparams.ptype;
> 
> > +            if (p_dirac_params->p_next_output_frame==NULL) {
> > +                p_dirac_params->p_next_output_frame=p_frame_output;
> > +                p_dirac_params->p_last_output_frame=p_frame_output;
> > +            } else {
> > +                p_dirac_params->p_last_output_frame->p_next_frame=p_frame_output;
> > +                p_dirac_params->p_last_output_frame=p_frame_output;
> > +            }
> 
> "p_dirac_params->p_last_output_frame=p_frame_output;" can be factored out
I'm sorry I didn't understand this comment. Does this refer to the
statement in the if part rather than the else part?
> 
> 
> > +            if (state == ENC_STATE_EOS) {
> > +                p_dirac_params->eos_pulled = 1;
> > +                go = 0;
> > +            }
> > +            break;
> > +
> > +        case ENC_STATE_BUFFER:
> > +            go = 0;
> > +            break;
> > +
> > +        case ENC_STATE_INVALID:
> > +            av_log(avccontext, AV_LOG_ERROR, "Unrecoverable Encoder Error. Quitting...\n");
> > +            return -1;
> > +                
> > +        default:
> > +            av_log(avccontext, AV_LOG_ERROR, "Unknown Encoder state\n");
> > +            return -1;
> > +        }
> > +    }
> > +
> > +    /* copy 'next' frame in queue */
> > +    p_next_output_frame=p_dirac_params->p_next_output_frame;
> > +    if (p_next_output_frame==NULL)
> > +        return 0;
> > +
> > +    memcpy(frame, p_next_output_frame->p_data, p_next_output_frame->size);
> > +    avccontext->coded_frame->key_frame= p_next_output_frame->type == INTRA_PICTURE;    
> 
> > +    avccontext->coded_frame->pts= AV_NOPTS_VALUE;    
> 
> This should be set to the correct pts from the matching input AVFrame.
Does this have to be the pts from the matching input AVFrame? Or can I
set it to the frame number of the encoded frame returned by the encoder?
> 

Regards,
Anuradha





More information about the ffmpeg-devel mailing list