39 |
#include "../bitstream/zigzag.h" |
#include "../bitstream/zigzag.h" |
40 |
#include "../dct/fdct.h" |
#include "../dct/fdct.h" |
41 |
#include "../dct/idct.h" |
#include "../dct/idct.h" |
42 |
#include "../quant/quant_mpeg4.h" |
#include "../quant/quant.h" |
|
#include "../quant/quant_h263.h" |
|
43 |
#include "../encoder.h" |
#include "../encoder.h" |
44 |
|
|
45 |
#include "../image/reduced.h" |
#include "../image/reduced.h" |
125 |
int mpeg; |
int mpeg; |
126 |
int scaler_lum, scaler_chr; |
int scaler_lum, scaler_chr; |
127 |
|
|
128 |
quanth263_intraFuncPtr const quant[2] = |
quant_intraFuncPtr const quant[2] = |
129 |
{ |
{ |
130 |
(quanth263_intraFuncPtr)quant_intra, |
quant_h263_intra, |
131 |
(quanth263_intraFuncPtr)quant4_intra |
quant_mpeg_intra |
132 |
}; |
}; |
133 |
|
|
134 |
mpeg = !!(pParam->vol_flags & XVID_VOL_MPEGQUANT); |
mpeg = !!(pParam->vol_flags & XVID_VOL_MPEGQUANT); |
156 |
int mpeg; |
int mpeg; |
157 |
int scaler_lum, scaler_chr; |
int scaler_lum, scaler_chr; |
158 |
|
|
159 |
quanth263_intraFuncPtr const dequant[2] = |
quant_intraFuncPtr const dequant[2] = |
160 |
{ |
{ |
161 |
(quanth263_intraFuncPtr)dequant_intra, |
dequant_h263_intra, |
162 |
(quanth263_intraFuncPtr)dequant4_intra |
dequant_mpeg_intra |
163 |
}; |
}; |
164 |
|
|
165 |
mpeg = !!(pParam->vol_flags & XVID_VOL_MPEGQUANT); |
mpeg = !!(pParam->vol_flags & XVID_VOL_MPEGQUANT); |
213 |
int sum; |
int sum; |
214 |
int code_block, mpeg; |
int code_block, mpeg; |
215 |
|
|
216 |
quanth263_interFuncPtr const quant[2] = |
quant_interFuncPtr const quant[2] = |
217 |
{ |
{ |
218 |
(quanth263_interFuncPtr)quant_inter, |
quant_h263_inter, |
219 |
(quanth263_interFuncPtr)quant4_inter |
quant_mpeg_inter |
220 |
}; |
}; |
221 |
|
|
222 |
trellis_func_ptr_t const trellis[2] = |
trellis_func_ptr_t const trellis[2] = |
223 |
{ |
{ |
224 |
(trellis_func_ptr_t)dct_quantize_trellis_h263_c, |
dct_quantize_trellis_h263_c, |
225 |
(trellis_func_ptr_t)dct_quantize_trellis_mpeg_c |
dct_quantize_trellis_mpeg_c |
226 |
}; |
}; |
227 |
|
|
228 |
mpeg = !!(pParam->vol_flags & XVID_VOL_MPEGQUANT); |
mpeg = !!(pParam->vol_flags & XVID_VOL_MPEGQUANT); |
276 |
{ |
{ |
277 |
int mpeg; |
int mpeg; |
278 |
|
|
279 |
quanth263_interFuncPtr const dequant[2] = |
quant_interFuncPtr const dequant[2] = |
280 |
{ |
{ |
281 |
(quanth263_interFuncPtr)dequant_inter, |
dequant_h263_inter, |
282 |
(quanth263_interFuncPtr)dequant4_inter |
dequant_mpeg_inter |
283 |
}; |
}; |
284 |
|
|
285 |
mpeg = !!(pParam->vol_flags & XVID_VOL_MPEGQUANT); |
mpeg = !!(pParam->vol_flags & XVID_VOL_MPEGQUANT); |
361 |
uint32_t cst; |
uint32_t cst; |
362 |
int vop_reduced; |
int vop_reduced; |
363 |
const IMAGE * const pCurrent = &frame->image; |
const IMAGE * const pCurrent = &frame->image; |
364 |
|
|
365 |
/* Array of function pointers, indexed by [vop_reduced<<1+add] */ |
/* Array of function pointers, indexed by [vop_reduced<<1+add] */ |
366 |
transfer_operation_16to8_t * const functions[4] = |
transfer_operation_16to8_t * const functions[4] = |
367 |
{ |
{ |
449 |
uint8_t cbp; |
uint8_t cbp; |
450 |
uint32_t limit; |
uint32_t limit; |
451 |
|
|
452 |
/* |
/* There is no MBTrans8to16 for Inter block, that's done in motion compensation |
453 |
* There is no MBTrans8to16 for Inter block, that's done in motion compensation |
* already */ |
|
* already |
|
|
*/ |
|
454 |
|
|
455 |
/* Perform DCT (and field decision) */ |
/* Perform DCT (and field decision) */ |
456 |
MBfDCT(pParam, frame, pMB, x_pos, y_pos, data); |
MBfDCT(pParam, frame, pMB, x_pos, y_pos, data); |
488 |
uint8_t cbp; |
uint8_t cbp; |
489 |
uint32_t limit; |
uint32_t limit; |
490 |
|
|
491 |
/* |
/* There is no MBTrans8to16 for Inter block, that's done in motion compensation |
492 |
* There is no MBTrans8to16 for Inter block, that's done in motion compensation |
* already */ |
|
* already |
|
|
*/ |
|
493 |
|
|
494 |
/* Perform DCT (and field decision) */ |
/* Perform DCT (and field decision) */ |
495 |
MBfDCT(pParam, frame, pMB, x_pos, y_pos, data); |
MBfDCT(pParam, frame, pMB, x_pos, y_pos, data); |
507 |
* History comment: |
* History comment: |
508 |
* We don't have to DeQuant, iDCT and Transfer back data for B-frames. |
* We don't have to DeQuant, iDCT and Transfer back data for B-frames. |
509 |
* |
* |
510 |
* BUT some plugins require the original frame to be passed so we have |
* BUT some plugins require the rebuilt original frame to be passed so we |
511 |
* to take care of that here |
* have to take care of that here |
512 |
*/ |
*/ |
513 |
if((pParam->plugin_flags & XVID_REQORIGINAL)) { |
if((pParam->plugin_flags & XVID_REQORIGINAL)) { |
514 |
|
|
633 |
MOVLINE(LINE(3, 3), tmp); |
MOVLINE(LINE(3, 3), tmp); |
634 |
} |
} |
635 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
636 |
/***************************************************************************** |
/***************************************************************************** |
637 |
* Trellis based R-D optimal quantization |
* Trellis based R-D optimal quantization |
638 |
* |
* |
640 |
* |
* |
641 |
****************************************************************************/ |
****************************************************************************/ |
642 |
|
|
|
|
|
|
#if 0 |
|
|
static int |
|
|
dct_quantize_trellis_mpeg_c(int16_t *const Out, |
|
|
const int16_t *const In, |
|
|
int Q, |
|
|
const uint16_t * const Zigzag, |
|
|
int Non_Zero) |
|
|
{ |
|
|
return 63; |
|
|
} |
|
|
#endif |
|
|
|
|
643 |
/*---------------------------------------------------------------------------- |
/*---------------------------------------------------------------------------- |
644 |
* |
* |
645 |
* Trellis-Based quantization |
* Trellis-Based quantization |