1 /*****************************************************************************
2 * vdec_block_h: Macroblock copy functions
3 *****************************************************************************
4 * Copyright (C) 1999, 2000, 2001 VideoLAN
5 * $Id: vdec_block.h,v 1.1 2001/05/06 04:32:02 sam 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_Init ) ( 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_mb->ppi_blocks[i_b], \
51 p_mb->pi_sparse_pos[i_b] ); \
54 * Adding prediction and coefficient data (ISO/IEC 13818-2 \
57 OPBLOCK( p_vdec, p_mb->ppi_blocks[i_b], \
58 p_mb->p_data[i_b], p_mb->i_addb_l_stride ); \
63 for( i_b = 4; i_b < 4 + p_mb->i_chroma_nb_blocks; \
64 i_b++, i_mask >>= 1 ) \
66 if( p_mb->i_coded_block_pattern & i_mask ) \
69 * Inverse DCT (ISO/IEC 13818-2 section Annex A) \
71 (p_mb->pf_idct[i_b])( p_vdec, p_mb->ppi_blocks[i_b], \
72 p_mb->pi_sparse_pos[i_b] ); \
75 * Adding prediction and coefficient data (ISO/IEC 13818-2 \
78 OPBLOCK( p_vdec, p_mb->ppi_blocks[i_b], \
79 p_mb->p_data[i_b], p_mb->i_addb_c_stride ); \
84 #define DECODEBLOCKSBW( OPBLOCK ) \
88 i_mask = 1 << (3 + p_mb->i_chroma_nb_blocks); \
91 for( i_b = 0; i_b < 4; i_b++, i_mask >>= 1 ) \
93 if( p_mb->i_coded_block_pattern & i_mask ) \
96 * Inverse DCT (ISO/IEC 13818-2 section Annex A) \
98 (p_mb->pf_idct[i_b])( p_vdec, p_mb->ppi_blocks[i_b], \
99 p_mb->pi_sparse_pos[i_b] ); \
102 * Adding prediction and coefficient data (ISO/IEC 13818-2 \
105 OPBLOCK( p_vdec, p_mb->ppi_blocks[i_b], \
106 p_mb->p_data[i_b], p_mb->i_addb_l_stride ); \