[vlc-devel] [PATCH 2/2] Codec update
francesco at bltitalia.com
francesco at bltitalia.com
Thu Aug 3 11:38:46 CEST 2017
From: Francesco Cuzzocrea <francesco at bltitalia.com>
---
modules/demux/blt/blt_jp2k_codec.c | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/modules/demux/blt/blt_jp2k_codec.c b/modules/demux/blt/blt_jp2k_codec.c
index 71a7b72..3e8e00c 100644
--- a/modules/demux/blt/blt_jp2k_codec.c
+++ b/modules/demux/blt/blt_jp2k_codec.c
@@ -390,7 +390,6 @@ int DecodeBlock(decoder_t *p_dec, block_t * p_block)
d_choffs = lsz + 4;
pDw = (uint32_t *) &p_block->p_start[lsz + 4];
chsz = __Swap32(*pDw);
- fprintf(stderr, "chroma size 0x%x ", chsz);
chsz <<= 2;
pDw++;
if ( *pDw != 0x51FF4FFF )
@@ -406,7 +405,7 @@ int DecodeBlock(decoder_t *p_dec, block_t * p_block)
delta_smpl = 1;
if ( p_sys->ui_imgH > 720 )
{
- i_scale_factor = 1;
+ i_scale_factor = 1; delta_smpl = 2;
}
if ( av_opt_set_int(p_sys->pCodecContext->priv_data, "lowres",
@@ -419,16 +418,19 @@ int DecodeBlock(decoder_t *p_dec, block_t * p_block)
{
msg_Err(p_dec, "Error rescaling picture");
}
+
p_sys->ui_imgH >>= i_scale_factor;
p_sys->ui_imgV >>= i_scale_factor;
p_dec->fmt_out.i_codec = VLC_CODEC_RGB24; // VLC_CODEC_UYVY; //
- p_dec->fmt_out.video.i_visible_width = p_dec->fmt_out.video.i_width =
- p_sys->ui_imgH;
- p_dec->fmt_out.video.i_visible_height = p_dec->fmt_out.video.i_height =
- p_sys->ui_imgV;
+ p_dec->fmt_out.video.i_visible_width = p_sys->ui_imgH;
+ p_dec->fmt_out.video.i_visible_height = p_sys->ui_imgV;
+ p_dec->fmt_out.video.i_width = p_sys->ui_imgH;
+ p_dec->fmt_out.video.i_height = p_sys->ui_imgV;
+
+
p_dec->fmt_out.video.i_sar_num = 1;
- p_dec->fmt_out.video.i_sar_den = 1;
+ p_dec->fmt_out.video.i_sar_den = 2; // Decompress only a field so aspect ratio is 1:2
p_dec->fmt_out.video.i_frame_rate = 25;
p_dec->fmt_out.video.i_frame_rate_base = 1;
@@ -567,11 +569,10 @@ int DecodeBlock(decoder_t *p_dec, block_t * p_block)
if ( i_conv_res == 0 )
blt_convertUYVY_to_rgb(p_sys, p_pic->p->p_pixels);
- p_pic->date =
- p_block->i_pts > VLC_TS_INVALID ? p_block->i_pts : p_block->i_dts;
+ p_pic->date = p_block->i_pts > VLC_TS_INVALID ? p_block->i_pts : p_block->i_dts;
- // p_pic->date = date_Get( &p_dec->p_sys->pts);
- // date_Increment(&p_sys->pts, delta_smpl);
+ p_pic->date = date_Get( &p_dec->p_sys->pts);
+ date_Increment(&p_sys->pts, delta_smpl);
if ( decoder_QueueVideo(p_dec, p_pic) < 0 )
msg_Err(p_dec, "################## Error queuing picture");
--
2.1.4
More information about the vlc-devel
mailing list