Mercurial > mplayer.hg
comparison libmpeg2/slice.c @ 31329:60709ef498be
Reinstate libmpeg2 hook to export quantization
The quant value is used by the postproc filters to fine tune their application
author | lu_zero |
---|---|
date | Mon, 14 Jun 2010 08:55:32 +0000 |
parents | a51baa308479 |
children |
comparison
equal
deleted
inserted
replaced
31328:599bf04eceeb | 31329:60709ef498be |
---|---|
18 * GNU General Public License for more details. | 18 * GNU General Public License for more details. |
19 * | 19 * |
20 * You should have received a copy of the GNU General Public License | 20 * You should have received a copy of the GNU General Public License |
21 * along with this program; if not, write to the Free Software | 21 * along with this program; if not, write to the Free Software |
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
23 * | |
24 * Modified for use with MPlayer, see libmpeg2_changes.diff for the exact changes. | |
25 * detailed changelog at http://svn.mplayerhq.hu/mplayer/trunk/ | |
26 * $Id$ | |
23 */ | 27 */ |
24 | 28 |
25 #include "config.h" | 29 #include "config.h" |
26 | 30 |
27 #include <inttypes.h> | 31 #include <inttypes.h> |
140 | 144 |
141 int quantizer_scale_code; | 145 int quantizer_scale_code; |
142 | 146 |
143 quantizer_scale_code = UBITS (bit_buf, 5); | 147 quantizer_scale_code = UBITS (bit_buf, 5); |
144 DUMPBITS (bit_buf, bits, 5); | 148 DUMPBITS (bit_buf, bits, 5); |
149 decoder->quantizer_scale = decoder->quantizer_scales[quantizer_scale_code]; | |
145 | 150 |
146 decoder->quantizer_matrix[0] = | 151 decoder->quantizer_matrix[0] = |
147 decoder->quantizer_prescale[0][quantizer_scale_code]; | 152 decoder->quantizer_prescale[0][quantizer_scale_code]; |
148 decoder->quantizer_matrix[1] = | 153 decoder->quantizer_matrix[1] = |
149 decoder->quantizer_prescale[1][quantizer_scale_code]; | 154 decoder->quantizer_prescale[1][quantizer_scale_code]; |
1562 mpeg2_mc.avg : mpeg2_mc.put)); \ | 1567 mpeg2_mc.avg : mpeg2_mc.put)); \ |
1563 } while (0) | 1568 } while (0) |
1564 | 1569 |
1565 #define NEXT_MACROBLOCK \ | 1570 #define NEXT_MACROBLOCK \ |
1566 do { \ | 1571 do { \ |
1572 if(decoder->quant_store) { \ | |
1573 if (decoder->picture_structure == TOP_FIELD) \ | |
1574 decoder->quant_store[2 * decoder->quant_stride \ | |
1575 * (decoder->v_offset >> 4) \ | |
1576 + (decoder->offset >> 4)] \ | |
1577 = decoder->quantizer_scale; \ | |
1578 else if (decoder->picture_structure == BOTTOM_FIELD) \ | |
1579 decoder->quant_store[2 * decoder->quant_stride \ | |
1580 * (decoder->v_offset >> 4) \ | |
1581 + decoder->quant_stride \ | |
1582 + (decoder->offset >> 4)] \ | |
1583 = decoder->quantizer_scale; \ | |
1584 else \ | |
1585 decoder->quant_store[decoder->quant_stride \ | |
1586 * (decoder->v_offset >> 4) \ | |
1587 + (decoder->offset >> 4)] \ | |
1588 = decoder->quantizer_scale; \ | |
1589 } \ | |
1567 decoder->offset += 16; \ | 1590 decoder->offset += 16; \ |
1568 if (decoder->offset == decoder->width) { \ | 1591 if (decoder->offset == decoder->width) { \ |
1569 do { /* just so we can use the break statement */ \ | 1592 do { /* just so we can use the break statement */ \ |
1570 if (decoder->convert) { \ | 1593 if (decoder->convert) { \ |
1571 decoder->convert (decoder->convert_id, decoder->dest, \ | 1594 decoder->convert (decoder->convert_id, decoder->dest, \ |