mirror of
https://github.com/mpv-player/mpv
synced 2025-01-04 22:20:22 +00:00
forgotten libmpeg2 postprocessing
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12936 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
ff1f7226f1
commit
267c4e26d3
@ -154,6 +154,17 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
|
||||
else mpi->fields &= ~MP_IMGFIELD_REPEAT_FIRST;
|
||||
mpi->fields |= MP_IMGFIELD_ORDERED;
|
||||
|
||||
#ifdef MPEG12_POSTPROC
|
||||
if(!mpi->qscale){
|
||||
mpi->qstride=(info->sequence->picture_width+15)>>4;
|
||||
mpi->qscale=malloc(mpi->qstride*((info->sequence->picture_height+15)>>4));
|
||||
}
|
||||
mpeg2dec->decoder.quant_store=mpi->qscale;
|
||||
mpeg2dec->decoder.quant_stride=mpi->qstride;
|
||||
mpi->pict_type=type; // 1->I, 2->P, 3->B
|
||||
mpi->qscale_type= 1;
|
||||
#endif
|
||||
|
||||
if(mpi->flags&MP_IMGFLAG_DRAW_CALLBACK &&
|
||||
!(mpi->flags&MP_IMGFLAG_DIRECT)){
|
||||
// nice, filter/vo likes draw_callback :)
|
||||
|
@ -803,6 +803,7 @@ static void prescale (mpeg2dec_t * mpeg2dec, int index)
|
||||
mpeg2dec->scaled[index] = mpeg2dec->q_scale_type;
|
||||
for (i = 0; i < 32; i++) {
|
||||
k = mpeg2dec->q_scale_type ? non_linear_scale[i] : (i << 1);
|
||||
decoder->quantizer_scale = k;
|
||||
for (j = 0; j < 64; j++)
|
||||
decoder->quantizer_prescale[index][i][j] =
|
||||
k * mpeg2dec->quantizer_matrix[index][j];
|
||||
|
@ -144,6 +144,11 @@ struct mpeg2_decoder_s {
|
||||
int second_field;
|
||||
|
||||
int mpeg1;
|
||||
|
||||
/* for MPlayer: */
|
||||
int quantizer_scale;
|
||||
char* quant_store;
|
||||
int quant_stride;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
|
@ -1564,6 +1564,9 @@ do { \
|
||||
|
||||
#define NEXT_MACROBLOCK \
|
||||
do { \
|
||||
if(decoder->quant_store) \
|
||||
decoder->quant_store[decoder->quant_stride*(decoder->v_offset>>4) \
|
||||
+(decoder->offset>>4)] = decoder->quantizer_scale; \
|
||||
decoder->offset += 16; \
|
||||
if (decoder->offset == decoder->width) { \
|
||||
do { /* just so we can use the break statement */ \
|
||||
|
Loading…
Reference in New Issue
Block a user