1 /*****************************************************************************
2 * vdec_block_h: Macroblock copy functions
3 *****************************************************************************
4 * Copyright (C) 1999, 2000, 2001 VideoLAN
5 * $Id: vdec_block.h,v 1.3 2001/07/17 09:48:07 massiot Exp $
7 * Authors: Christophe Massiot <massiot@via.ecp.fr>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
22 *****************************************************************************/
24 /*****************************************************************************
26 *****************************************************************************/
27 void _M( vdec_InitDecode ) ( struct vdec_thread_s *p_vdec );
28 void _M( vdec_DecodeMacroblockC ) ( struct vdec_thread_s *p_vdec,
29 struct macroblock_s * p_mb );
30 void _M( vdec_DecodeMacroblockBW ) ( struct vdec_thread_s *p_vdec,
31 struct macroblock_s * p_mb );
33 /*****************************************************************************
34 * vdec_DecodeMacroblock : decode a macroblock of a picture
35 *****************************************************************************/
36 #define DECODEBLOCKSC( OPBLOCK ) \
40 i_mask = 1 << (3 + p_mb->i_chroma_nb_blocks); \
43 for( i_b = 0; i_b < 4; i_b++, i_mask >>= 1 ) \
45 if( p_mb->i_coded_block_pattern & i_mask ) \
48 * Inverse DCT (ISO/IEC 13818-2 section Annex A) \
50 (p_mb->pf_idct[i_b])( p_vdec->p_idct_data, \
51 p_mb->ppi_blocks[i_b], \
52 p_mb->pi_sparse_pos[i_b] ); \
55 * Adding prediction and coefficient data (ISO/IEC 13818-2 \
58 OPBLOCK( p_vdec, p_mb->ppi_blocks[i_b], \
59 p_mb->p_data[i_b], p_mb->i_addb_l_stride ); \
64 for( i_b = 4; i_b < 4 + p_mb->i_chroma_nb_blocks; \
65 i_b++, i_mask >>= 1 ) \
67 if( p_mb->i_coded_block_pattern & i_mask ) \
70 * Inverse DCT (ISO/IEC 13818-2 section Annex A) \
72 (p_mb->pf_idct[i_b])( p_vdec->p_idct_data, \
73 p_mb->ppi_blocks[i_b], \
74 p_mb->pi_sparse_pos[i_b] ); \
77 * Adding prediction and coefficient data (ISO/IEC 13818-2 \
80 OPBLOCK( p_vdec, p_mb->ppi_blocks[i_b], \
81 p_mb->p_data[i_b], p_mb->i_addb_c_stride ); \
86 #define DECODEBLOCKSBW( OPBLOCK ) \
90 i_mask = 1 << (3 + p_mb->i_chroma_nb_blocks); \
93 for( i_b = 0; i_b < 4; i_b++, i_mask >>= 1 ) \
95 if( p_mb->i_coded_block_pattern & i_mask ) \
98 * Inverse DCT (ISO/IEC 13818-2 section Annex A) \
100 (p_mb->pf_idct[i_b])( p_vdec->p_idct_data, \
101 p_mb->ppi_blocks[i_b], \
102 p_mb->pi_sparse_pos[i_b] ); \
105 * Adding prediction and coefficient data (ISO/IEC 13818-2 \
108 OPBLOCK( p_vdec, p_mb->ppi_blocks[i_b], \
109 p_mb->p_data[i_b], p_mb->i_addb_l_stride ); \