Commit 519cac7a authored by Rafaël Carré's avatar Rafaël Carré Committed by Jean-Paul Saman

DaVinci decoder: Change default fps and bitrate : 1000kbps @25fps

Update debug messages
Signed-off-by: Jean-Paul Saman's avatarJean-Paul Saman <jean-paul.saman@m2x.nl>
parent f44051d3
......@@ -25,7 +25,7 @@
* Preamble
*****************************************************************************/
#include "davinci.h"
#include <assert.h>
#include <ti/sdo/ce/video/viddec.h>
/*****************************************************************************
......@@ -149,8 +149,8 @@ int OpenVideoDecoder( vlc_object_t *p_this )
params.size = sizeof( VIDDEC_Params );
params.maxHeight = p_dec->fmt_in.video.i_height?:576;
params.maxWidth = p_dec->fmt_in.video.i_width?:720;
params.maxFrameRate = 0; /* in frames per 1000 seconds */
params.maxBitRate = 0; /* in bits per second */
params.maxFrameRate = 25000; /* in frames per 1000 seconds */
params.maxBitRate = 1000000; /* in bits per second */
params.dataEndianness = XDM_BYTE;//LE_32;
params.forceChromaFormat = VlcChromaToXdm( i_chroma );
if( params.forceChromaFormat == XDM_CHROMA_NA )
......@@ -168,12 +168,6 @@ int OpenVideoDecoder( vlc_object_t *p_this )
}
/* Set output properties */
#ifdef DEBUG_DAVINCI
msg_Info( p_dec, "fmt_in.video.i_width: %d", p_dec->fmt_in.video.i_width );
msg_Info( p_dec, "fmt_in.video.i_height: %d", p_dec->fmt_in.video.i_height );
msg_Info( p_dec, "fmt_out.video.i_width: %d", p_dec->fmt_out.video.i_width );
msg_Info( p_dec, "fmt_out.video.i_height: %d", p_dec->fmt_out.video.i_height );
#endif
p_dec->fmt_out.i_cat = VIDEO_ES;
p_dec->fmt_out.i_codec =
p_dec->fmt_out.video.i_chroma = i_chroma;
......@@ -184,10 +178,6 @@ int OpenVideoDecoder( vlc_object_t *p_this )
/* Set callbacks */
p_dec->pf_decode_video = DecodeVideoBlock;
#ifdef DEBUG_DAVINCI
msg_Info( p_dec, "Woohoo!" );
#endif
free( psz_codec );
free( psz_engine );
return VLC_SUCCESS;
......@@ -246,10 +236,6 @@ static picture_t *DecodeVideoBlockInner( decoder_t *p_dec, block_t **pp_block, i
if( !pp_block || !*pp_block ) return NULL;
p_block = *pp_block;
#ifdef DEBUG_DAVINCI
msg_Err( p_dec, "DecodeVideoBlock starts now!" );
#endif
if( p_block->i_flags & (BLOCK_FLAG_DISCONTINUITY|BLOCK_FLAG_CORRUPTED) )
{
block_Release( p_block );
......@@ -307,29 +293,22 @@ static picture_t *DecodeVideoBlockInner( decoder_t *p_dec, block_t **pp_block, i
in_args.inputID = 0; /* FIXME? */
/* Setup input buffer */
#ifdef DEBUG_DAVINCI
if( p_block->i_buffer > p_sys->in.bufSizes[0] )
msg_Dbg( p_dec, "Woah! Not enough room to store the whole block" );
#endif
assert( p_block->i_buffer <= p_sys->in.bufSizes[0] );
if( i_extra > 0 )
{
memcpy( p_sys->in.bufs[0], p_dec->fmt_in.p_extra, i_extra );
}
memcpy( p_sys->in.bufs[0] + i_extra, p_block->p_buffer,
in_args.numBytes - i_extra );
#ifdef DEBUG_DAVINCI
msg_Dbg( p_dec, "Sending %d + %d bytes", i_extra,
(int)in_args.numBytes - i_extra );
#endif
#ifdef DEBUG_DAVINCI
msg_Info( p_dec, "Frame info: " );
msg_Info( p_dec, " Width: %d", (int)status.outputWidth );
msg_Info( p_dec, " Height: %d", (int)status.outputHeight );
msg_Info( p_dec, " Content type: %s",
msg_Dbg( p_dec, "Frame is %d bytes (%d extra), %dx%d, type %s",
(int)in_args.numBytes, i_extra, (int)status.outputWidth,
(int)status.outputHeight,
status.contentType == IVIDEO_PROGRESSIVE ? "progressive" :
status.contentType == IVIDEO_INTERLACED ? "interlaced" :
"not available" );
"unknown" );
#endif
/* Setup output arguemnts */
......@@ -337,9 +316,6 @@ static picture_t *DecodeVideoBlockInner( decoder_t *p_dec, block_t **pp_block, i
/* That was easy :p */
/* Decode the video */
#ifdef DEBUG_DAVINCI
printf("%s %s %d\n", __FILE__, __func__, __LINE__);
#endif
if( ( i = VIDDEC_process( p_sys->d, &p_sys->in, &p_sys->out, &in_args, &out_args ) )
!= VIDDEC_EOK )
{
......@@ -353,9 +329,6 @@ static picture_t *DecodeVideoBlockInner( decoder_t *p_dec, block_t **pp_block, i
}
goto error;
}
#ifdef DEBUG_DAVINCI
printf("%s %s %d\n", __FILE__, __func__, __LINE__);
#endif
if( VIDDEC_control( p_sys->d, XDM_GETSTATUS, &dparams, &status ) != VIDDEC_EOK )
{
......@@ -364,11 +337,7 @@ static picture_t *DecodeVideoBlockInner( decoder_t *p_dec, block_t **pp_block, i
}
#ifdef DEBUG_DAVINCI
msg_Info( p_dec, "After decoder info: " );
msg_Info( p_dec, " Width: %d", (int)status.outputWidth );
msg_Info( p_dec, " Height: %d", (int)status.outputHeight );
msg_Info( p_dec, " Content type: %s", status.contentType == IVIDEO_PROGRESSIVE ? "progressive" : status.contentType == IVIDEO_INTERLACED ? "interlaced" : "not available" );
msg_Info( p_dec, " Bytes consumed: %d", (int)out_args.bytesConsumed );
msg_Dbg( p_dec, "Bytes consumed: %d", (int)out_args.bytesConsumed );
#endif
p_block->p_buffer += out_args.bytesConsumed - i_extra;
......@@ -420,11 +389,7 @@ static picture_t *DecodeVideoBlockInner( decoder_t *p_dec, block_t **pp_block, i
}
#endif
if( p_pic->i_planes != p_sys->out.numBufs )
{
msg_Err( p_dec, "Ahem ... looks like I assumed something wrong. Please investigate." );
goto error;
}
assert( p_pic->i_planes == p_sys->out.numBufs );
for( i = 0; i < p_pic->i_planes; i++ )
{
......@@ -434,13 +399,9 @@ static picture_t *DecodeVideoBlockInner( decoder_t *p_dec, block_t **pp_block, i
p_pic->date = p_block->i_pts > 0 ? p_block->i_pts : p_block->i_dts;
#ifdef DEBUG_DAVINCI
msg_Info( p_dec, "Yay! Frame decoded correctly" );
#endif
if( p_block->i_buffer == 0 )
{
block_Release( p_block ); /* Not sure about this one */
block_Release( p_block );
*pp_block = NULL;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment