[cvs] / xvidcore / src / utils / mbtransquant.c Repository:
ViewVC logotype

Diff of /xvidcore/src/utils/mbtransquant.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4, Fri Mar 29 00:38:29 2002 UTC revision 1.6, Thu Apr 25 06:55:00 2002 UTC
# Line 73  Line 73 
73  /* this isnt pretty, but its better than 20 ifdefs */  /* this isnt pretty, but its better than 20 ifdefs */
74    
75  void MBTransQuantIntra(const MBParam *pParam,  void MBTransQuantIntra(const MBParam *pParam,
76                                               FRAMEINFO * frame,
77                         MACROBLOCK * pMB,                         MACROBLOCK * pMB,
78                         const uint32_t x_pos,                         const uint32_t x_pos,
79                         const uint32_t y_pos,                         const uint32_t y_pos,
80                         int16_t data[6*64],                         int16_t data[6*64],
81                         int16_t qcoeff[6*64],                         int16_t qcoeff[6*64])
                        IMAGE * const pCurrent)  
82    
83  {  {
84    
# Line 86  Line 86 
86          uint32_t stride2 = stride / 2;          uint32_t stride2 = stride / 2;
87          uint32_t next_block = stride * 8;          uint32_t next_block = stride * 8;
88          uint32_t i;          uint32_t i;
89          uint32_t iQuant = pParam->quant;          uint32_t iQuant = frame->quant;
90          uint8_t *pY_Cur, *pU_Cur, *pV_Cur;          uint8_t *pY_Cur, *pU_Cur, *pV_Cur;
91            IMAGE * pCurrent = &frame->image;
92    
93          pY_Cur = pCurrent->y + (y_pos << 4) * stride + (x_pos << 4);          pY_Cur = pCurrent->y + (y_pos << 4) * stride + (x_pos << 4);
94          pU_Cur = pCurrent->u + (y_pos << 3) * stride2 + (x_pos << 3);          pU_Cur = pCurrent->u + (y_pos << 3) * stride2 + (x_pos << 3);
# Line 104  Line 105 
105    
106          start_timer();          start_timer();
107          pMB->field_dct = 0;          pMB->field_dct = 0;
108          if (pParam->global_flags & XVID_INTERLACING)          if ((frame->global_flags & XVID_INTERLACING))
109          {          {
110                  pMB->field_dct = MBDecideFieldDCT(data);                  pMB->field_dct = MBDecideFieldDCT(data);
111          }          }
# Line 118  Line 119 
119                  fdct(&data[i*64]);                  fdct(&data[i*64]);
120                  stop_dct_timer();                  stop_dct_timer();
121    
122                  if (pParam->quant_type == H263_QUANT)                  if (pParam->m_quant_type == H263_QUANT)
123                  {                  {
124                          start_timer();                          start_timer();
125                          quant_intra(&qcoeff[i*64], &data[i*64], iQuant, iDcScaler);                          quant_intra(&qcoeff[i*64], &data[i*64], iQuant, iDcScaler);
# Line 163  Line 164 
164    
165    
166  uint8_t MBTransQuantInter(const MBParam *pParam,  uint8_t MBTransQuantInter(const MBParam *pParam,
167                              FRAMEINFO * frame,
168                            MACROBLOCK * pMB,                            MACROBLOCK * pMB,
169                            const uint32_t x_pos, const uint32_t y_pos,                            const uint32_t x_pos, const uint32_t y_pos,
170                            int16_t data[6*64],                            int16_t data[6*64],
171                            int16_t qcoeff[6*64],                            int16_t qcoeff[6*64])
                           IMAGE * const pCurrent)  
172    
173  {  {
174    
# Line 175  Line 176 
176          uint32_t stride2 = stride / 2;          uint32_t stride2 = stride / 2;
177          uint32_t next_block = stride * 8;          uint32_t next_block = stride * 8;
178          uint32_t i;          uint32_t i;
179          uint32_t iQuant = pParam->quant;          uint32_t iQuant = frame->quant;
180          uint8_t *pY_Cur, *pU_Cur, *pV_Cur;          uint8_t *pY_Cur, *pU_Cur, *pV_Cur;
181          uint8_t cbp = 0;          uint8_t cbp = 0;
182          uint32_t sum;          uint32_t sum;
183            IMAGE * pCurrent = &frame->image;
184    
185          pY_Cur = pCurrent->y + (y_pos << 4) * stride + (x_pos << 4);          pY_Cur = pCurrent->y + (y_pos << 4) * stride + (x_pos << 4);
186          pU_Cur = pCurrent->u + (y_pos << 3) * stride2 + (x_pos << 3);          pU_Cur = pCurrent->u + (y_pos << 3) * stride2 + (x_pos << 3);
# Line 186  Line 188 
188    
189          start_timer();          start_timer();
190          pMB->field_dct = 0;          pMB->field_dct = 0;
191          if (pParam->global_flags & XVID_INTERLACING)          if ((frame->global_flags & XVID_INTERLACING))
192          {          {
193                  pMB->field_dct = MBDecideFieldDCT(data);                  pMB->field_dct = MBDecideFieldDCT(data);
194          }          }
# Line 202  Line 204 
204                  fdct(&data[i*64]);                  fdct(&data[i*64]);
205                  stop_dct_timer();                  stop_dct_timer();
206    
207                  if (pParam->quant_type == 0)                  if (pParam->m_quant_type == 0)
208                  {                  {
209                          start_timer();                          start_timer();
210                          sum = quant_inter(&qcoeff[i*64], &data[i*64], iQuant);                          sum = quant_inter(&qcoeff[i*64], &data[i*64], iQuant);
# Line 217  Line 219 
219    
220                  if(sum >= TOOSMALL_LIMIT) { // skip block ?                  if(sum >= TOOSMALL_LIMIT) { // skip block ?
221    
222                          if (pParam->quant_type == H263_QUANT)                          if (pParam->m_quant_type == H263_QUANT)
223                          {                          {
224                                  start_timer();                                  start_timer();
225                                  dequant_inter(&data[i*64], &qcoeff[i*64], iQuant);                                  dequant_inter(&data[i*64], &qcoeff[i*64], iQuant);
# Line 266  Line 268 
268    
269  /* if sum(diff between field lines) < sum(diff between frame lines), use field dct */  /* if sum(diff between field lines) < sum(diff between frame lines), use field dct */
270    
 #define ABS(X) (X)<0 ? -(X) : (X)  
271    
272  uint32_t MBDecideFieldDCT(int16_t data[6*64])  uint32_t MBDecideFieldDCT(int16_t data[6*64])
273  {  {

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.6

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4