[svn] / trunk / xvidcore / src / quant / quant_matrix.c Repository:
ViewVC logotype

Diff of /trunk/xvidcore/src/quant/quant_matrix.c

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

revision 1712, Sat Jul 8 14:19:04 2006 UTC revision 1713, Mon Jul 10 08:09:59 2006 UTC
# Line 20  Line 20 
20   *  along with this program ; if not, write to the Free Software   *  along with this program ; if not, write to the Free Software
21   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
22   *   *
23   * $Id: quant_matrix.c,v 1.14 2004-03-22 22:36:24 edgomez Exp $   * $Id: quant_matrix.c,v 1.15 2006-07-10 08:09:59 syskin Exp $
24   *   *
25   ****************************************************************************/   ****************************************************************************/
26    
# Line 112  Line 112 
112  {  {
113          int i;          int i;
114          uint16_t *intra_matrix = mpeg_quant_matrices + 0*64;          uint16_t *intra_matrix = mpeg_quant_matrices + 0*64;
         uint16_t *intra_matrix1 = mpeg_quant_matrices + 1*64;  
         uint16_t *intra_matrix_fix = mpeg_quant_matrices + 2*64;  
         uint16_t *intra_matrix_fixl = mpeg_quant_matrices + 3*64;  
115    
116          for (i = 0; i < 64; i++) {          for (i = 0; i < 64; i++) {
117                  intra_matrix[i] = (!i) ? (uint16_t)8: (uint16_t)matrix[i];                  intra_matrix[i] = (!i) ? (uint16_t)8: (uint16_t)matrix[i];
118                  intra_matrix1[i] = (intra_matrix[i]>>1);          }
119                  intra_matrix1[i] += ((intra_matrix[i] == 1) ? 1: 0);  }
120                  intra_matrix_fix[i] = FIX(intra_matrix[i]);  
121                  intra_matrix_fixl[i] = FIXL(intra_matrix[i]);  void
122    init_intra_matrix(uint16_t * mpeg_quant_matrices, uint32_t quant)
123    {
124            int i;
125            uint16_t *intra_matrix = mpeg_quant_matrices + 0*64;
126            uint16_t *intra_matrix_rec = mpeg_quant_matrices + 1*64;
127    
128            for (i = 0; i < 64; i++) {
129                    uint32_t div = intra_matrix[i]*quant;
130                    intra_matrix_rec[i] = ((1<<SCALEBITS) + (div>>1))/div;
131          }          }
132  }  }
133    

Legend:
Removed from v.1712  
changed lines
  Added in v.1713

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