X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fcodec%2Fdirac.c;h=97253cf9f358ef59b1194c7a44013b9149be65e7;hb=4b6374f99c8fffa99fc259bc120f090188298591;hp=2028775388d37fad7a9d01f0000f7b9235f4d94c;hpb=f5c5a773147fccc0255acabd50961e042ade393f;p=vlc diff --git a/modules/codec/dirac.c b/modules/codec/dirac.c index 2028775388..97253cf9f3 100644 --- a/modules/codec/dirac.c +++ b/modules/codec/dirac.c @@ -26,8 +26,9 @@ * Preamble *****************************************************************************/ #include -#include -#include +#include +#include +#include #include #include @@ -144,13 +145,15 @@ static picture_t *GetNewPicture( decoder_t *p_dec ) picture_t *p_pic; int i_plane; - p_dec->fmt_out.i_codec = - p_sys->p_dirac->seq_params.chroma == format411 ? - VLC_FOURCC('I','4','1','1') : - p_sys->p_dirac->seq_params.chroma == format420 ? - VLC_FOURCC('I','4','2','0') : - p_sys->p_dirac->seq_params.chroma == format422 ? - VLC_FOURCC('I','4','2','2') : 0; + switch( p_sys->p_dirac->seq_params.chroma ) + { + case format420: p_dec->fmt_out.i_codec = VLC_FOURCC('I','4','2','0'); break; + case format422: p_dec->fmt_out.i_codec = VLC_FOURCC('I','4','2','2'); break; + case format444: p_dec->fmt_out.i_codec = VLC_FOURCC('I','4','4','4'); break; // XXX 0.6 ? + default: + p_dec->fmt_out.i_codec = 0; + break; + } p_dec->fmt_out.video.i_visible_width = p_dec->fmt_out.video.i_width = p_sys->p_dirac->seq_params.width; @@ -159,17 +162,17 @@ static picture_t *GetNewPicture( decoder_t *p_dec ) p_dec->fmt_out.video.i_aspect = VOUT_ASPECT_FACTOR * 4 / 3; p_dec->fmt_out.video.i_frame_rate = - p_sys->p_dirac->seq_params.frame_rate.numerator; + p_sys->p_dirac->src_params.frame_rate.numerator; p_dec->fmt_out.video.i_frame_rate_base = - p_sys->p_dirac->seq_params.frame_rate.denominator; + p_sys->p_dirac->src_params.frame_rate.denominator; /* Get a new picture */ p_pic = p_dec->pf_vout_buffer_new( p_dec ); if( p_pic == NULL ) return NULL; + p_pic->b_progressive = !p_sys->p_dirac->src_params.interlace; + p_pic->b_top_field_first = p_sys->p_dirac->src_params.topfieldfirst; - p_pic->b_progressive = !p_sys->p_dirac->seq_params.interlace; - p_pic->b_top_field_first = p_sys->p_dirac->seq_params.topfieldfirst; p_pic->i_nb_fields = 2; /* Copy picture stride by stride */ @@ -184,7 +187,7 @@ static picture_t *GetNewPicture( decoder_t *p_dec ) for( i_line = 0; i_line < p_pic->p[i_plane].i_visible_lines; i_line++ ) { - p_dec->p_vlc->pf_memcpy( p_dst, p_src, i_width ); + p_dec->p_libvlc->pf_memcpy( p_dst, p_src, i_width ); p_src += i_width; p_dst += i_dst_stride; } @@ -251,8 +254,8 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) p_sys->p_dirac->seq_params.width, p_sys->p_dirac->seq_params.height, p_sys->p_dirac->seq_params.chroma, - (float)p_sys->p_dirac->seq_params.frame_rate.numerator/ - p_sys->p_dirac->seq_params.frame_rate.denominator ); + (float)p_sys->p_dirac->src_params.frame_rate.numerator/ + p_sys->p_dirac->src_params.frame_rate.denominator ); FreeFrameBuffer( p_sys->p_dirac ); buf[0] = malloc( p_sys->p_dirac->seq_params.width * @@ -350,22 +353,20 @@ static int OpenEncoder( vlc_object_t *p_this ) p_enc->fmt_in.video.i_bits_per_pixel = 12; p_enc->fmt_out.i_codec = VLC_FOURCC('d','r','a','c'); - sout_CfgParse( p_enc, ENC_CFG_PREFIX, ppsz_enc_options, p_enc->p_cfg ); - - /* Initialse the encoder context with the presets for SD576 - Standard - * Definition Digital (some parameters will be overwritten later on) */ - dirac_encoder_context_init( &p_sys->ctx, SD576 ); + config_ChainParse( p_enc, ENC_CFG_PREFIX, ppsz_enc_options, p_enc->p_cfg ); - /* Override parameters if required */ + dirac_encoder_context_init( &p_sys->ctx, VIDEO_FORMAT_CUSTOM ); + /* */ p_sys->ctx.seq_params.width = p_enc->fmt_in.video.i_width; p_sys->ctx.seq_params.height = p_enc->fmt_in.video.i_height; p_sys->ctx.seq_params.chroma = format420; - p_sys->ctx.seq_params.frame_rate.numerator = + /* */ + p_sys->ctx.src_params.frame_rate.numerator = p_enc->fmt_in.video.i_frame_rate; - p_sys->ctx.seq_params.frame_rate.denominator = + p_sys->ctx.src_params.frame_rate.denominator = p_enc->fmt_in.video.i_frame_rate_base; - p_sys->ctx.seq_params.interlace = 0; - p_sys->ctx.seq_params.topfieldfirst = 0; + p_sys->ctx.src_params.interlace = 0; + p_sys->ctx.src_params.topfieldfirst = 0; var_Get( p_enc, ENC_CFG_PREFIX "quality", &val ); f_quality = val.f_float; @@ -406,7 +407,7 @@ static block_t *Encode( encoder_t *p_enc, picture_t *p_pic ) for( i_line = 0; i_line < p_pic->p[i_plane].i_visible_lines; i_line++ ) { - p_enc->p_vlc->pf_memcpy( p_dst, p_src, i_width ); + p_enc->p_libvlc->pf_memcpy( p_dst, p_src, i_width ); p_dst += i_width; p_src += i_src_stride; }