@ -20,9 +20,9 @@
* Foundation , Inc . , 51 Franklin Street , Fifth Floor , Boston , MA 02110 - 1301 USA
*/
# define NOT_MPEG12 0
# define MAY_BE_MPEG12 1
# define DEFINITELY_MPEG12 2
# define NOT_MPEG12_H261 0
# define MAY_BE_MPEG12_H261 1
# define DEFINITELY_MPEG12_H261 2
/* put block[] to dest[] */
static inline void put_dct ( MpegEncContext * s ,
@ -56,14 +56,14 @@ static av_always_inline
void mpv_reconstruct_mb_internal ( MpegEncContext * s , int16_t block [ 12 ] [ 64 ] ,
int lowres_flag , int is_mpeg12 )
{
# define IS_MPEG12(s) (is_mpeg12 == MAY_BE_MPEG12 ? ((s)->out_format == FMT_MPEG 1) : is_mpeg12)
# define IS_MPEG12_H261(s) (is_mpeg12 == MAY_BE_MPEG12_H261 ? ((s)->out_format <= FMT_H26 1) : is_mpeg12)
const int mb_xy = s - > mb_y * s - > mb_stride + s - > mb_x ;
s - > cur_pic . qscale_table [ mb_xy ] = s - > qscale ;
/* update DC predictors for P macroblocks */
if ( ! s - > mb_intra ) {
if ( is_mpeg12 ! = DEFINITELY_MPEG12 & & ( s - > h263_pred | | s - > h263_aic ) ) {
if ( is_mpeg12 ! = DEFINITELY_MPEG12_H261 & & ( s - > h263_pred | | s - > h263_aic ) ) {
if ( s - > mbintra_table [ mb_xy ] )
ff_clean_intra_table_entries ( s ) ;
} else {
@ -71,7 +71,7 @@ void mpv_reconstruct_mb_internal(MpegEncContext *s, int16_t block[12][64],
s - > last_dc [ 1 ] =
s - > last_dc [ 2 ] = 128 < < s - > intra_dc_precision ;
}
} else if ( is_mpeg12 ! = DEFINITELY_MPEG12 & & ( s - > h263_pred | | s - > h263_aic ) )
} else if ( is_mpeg12 ! = DEFINITELY_MPEG12_H261 & & ( s - > h263_pred | | s - > h263_aic ) )
s - > mbintra_table [ mb_xy ] = 1 ;
# if IS_ENCODER
@ -110,7 +110,7 @@ void mpv_reconstruct_mb_internal(MpegEncContext *s, int16_t block[12][64],
/* decoding or more than one mb_type (MC was already done otherwise) */
# if !IS_ENCODER
if ( HAVE_THREADS & & is_mpeg12 ! = DEFINITELY_MPEG12 & &
if ( HAVE_THREADS & & is_mpeg12 ! = DEFINITELY_MPEG12_H261 & &
s - > avctx - > active_thread_type & FF_THREAD_FRAME ) {
if ( s - > mv_dir & MV_DIR_FORWARD ) {
ff_thread_progress_await ( & s - > last_pic . ptr - > progress ,
@ -136,7 +136,7 @@ void mpv_reconstruct_mb_internal(MpegEncContext *s, int16_t block[12][64],
const op_pixels_func ( * op_pix ) [ 4 ] ;
const qpel_mc_func ( * op_qpix ) [ 16 ] ;
if ( ( is_mpeg12 = = DEFINITELY_MPEG12 | | ! s - > no_rounding ) | | s - > pict_type = = AV_PICTURE_TYPE_B ) {
if ( ( is_mpeg12 = = DEFINITELY_MPEG12_H261 | | ! s - > no_rounding ) | | s - > pict_type = = AV_PICTURE_TYPE_B ) {
op_pix = s - > hdsp . put_pixels_tab ;
op_qpix = s - > qdsp . put_qpel_pixels_tab ;
} else {
@ -162,7 +162,7 @@ void mpv_reconstruct_mb_internal(MpegEncContext *s, int16_t block[12][64],
}
/* add dct residue */
if ( ! ( IS_MPEG12 ( s ) | | s - > msmpeg4_version ! = MSMP4_UNUSED | |
if ( ! ( IS_MPEG12_H261 ( s ) | | s - > msmpeg4_version ! = MSMP4_UNUSED | |
( s - > codec_id = = AV_CODEC_ID_MPEG4 & & ! s - > mpeg_quant ) ) )
# endif /* !IS_ENCODER */
{
@ -187,7 +187,7 @@ void mpv_reconstruct_mb_internal(MpegEncContext *s, int16_t block[12][64],
}
}
# if !IS_ENCODER
else if ( is_mpeg12 = = DEFINITELY_MPEG12 | | lowres_flag | | ( s - > codec_id ! = AV_CODEC_ID_WMV2 ) ) {
else if ( is_mpeg12 = = DEFINITELY_MPEG12_H261 | | lowres_flag | | ( s - > codec_id ! = AV_CODEC_ID_WMV2 ) ) {
add_dct ( s , block [ 0 ] , 0 , dest_y , dct_linesize ) ;
add_dct ( s , block [ 1 ] , 1 , dest_y + block_size , dct_linesize ) ;
add_dct ( s , block [ 2 ] , 2 , dest_y + dct_offset , dct_linesize ) ;
@ -222,12 +222,12 @@ void mpv_reconstruct_mb_internal(MpegEncContext *s, int16_t block[12][64],
# if !IS_ENCODER
/* Only MPEG-4 Simple Studio Profile is supported in > 8-bit mode.
TODO : Integrate 10 - bit properly into mpegvideo . c so that ER works properly */
if ( is_mpeg12 ! = DEFINITELY_MPEG12 & & CONFIG_MPEG4_DECODER & &
if ( is_mpeg12 ! = DEFINITELY_MPEG12_H261 & & CONFIG_MPEG4_DECODER & &
/* s->codec_id == AV_CODEC_ID_MPEG4 && */
s - > avctx - > bits_per_raw_sample > 8 ) {
ff_mpeg4_decode_studio ( s , dest_y , dest_cb , dest_cr , block_size ,
uvlinesize , dct_linesize , dct_offset ) ;
} else if ( ! IS_MPEG12 ( s ) )
} else if ( ! IS_MPEG12_H261 ( s ) )
# endif /* !IS_ENCODER */
{
/* dct only in intra block */