+#define TEST_QUANT8( qname, cqm, shift, divider ) \
+ if( qf_a.qname != qf_ref.qname ) \
+ { \
+ int qp; \
+ used_asms[0] = 1; \
+ for( qp = 51; qp > 0; qp-- ) \
+ { \
+ INIT_QUANT8() \
+ qf_c.qname( (void*)dct1, cqm[qp%6], shift+qp/6, (1<<(shift+qp/6))/divider ); \
+ qf_a.qname( (void*)dct2, cqm[qp%6], shift+qp/6, (1<<(shift+qp/6))/divider ); \
+ if( memcmp( dct1, dct2, 64*2 ) ) \
+ { \
+ oks[0] = 0; \
+ fprintf( stderr, #qname "(qp=%d, cqm=%d, intra=%d): [FAILED]\n", qp, i_cqm, divider==3 ); \
+ break; \
+ } \
+ } \
+ }
+
+#define TEST_QUANT4( qname, cqm, shift, divider ) \
+ if( qf_a.qname != qf_ref.qname ) \
+ { \
+ int qp; \
+ used_asms[0] = 1; \
+ for( qp = 51; qp > 0; qp-- ) \
+ { \
+ INIT_QUANT4() \
+ qf_c.qname( (void*)dct1, cqm[qp%6], shift+qp/6, (1<<(shift+qp/6))/divider ); \
+ qf_a.qname( (void*)dct2, cqm[qp%6], shift+qp/6, (1<<(shift+qp/6))/divider ); \
+ if( memcmp( dct1, dct2, 16*2 ) ) \
+ { \
+ oks[0] = 0; \
+ fprintf( stderr, #qname "(qp=%d, cqm=%d, intra=%d): [FAILED]\n", qp, i_cqm, divider==3 ); \
+ break; \
+ } \
+ } \
+ }
+
+ TEST_QUANT8( quant_8x8_core, h->quant8_mf[CQM_8IY], 16, 3 );
+ TEST_QUANT8( quant_8x8_core, h->quant8_mf[CQM_8PY], 16, 6 );
+ TEST_QUANT4( quant_4x4_core, h->quant4_mf[CQM_4IY], 15, 3 );
+ TEST_QUANT4( quant_4x4_core, h->quant4_mf[CQM_4PY], 15, 6 );