Revision 944721c1 libavcodec/mjpegenc.c

View differences:

libavcodec/mjpegenc.c
67 67
    s->max_qcoeff= 1023;
68 68

  
69 69
    /* build all the huffman tables */
70
    build_huffman_codes(m->huff_size_dc_luminance,
71
                        m->huff_code_dc_luminance,
72
                        bits_dc_luminance,
73
                        val_dc_luminance);
74
    build_huffman_codes(m->huff_size_dc_chrominance,
75
                        m->huff_code_dc_chrominance,
76
                        bits_dc_chrominance,
77
                        val_dc_chrominance);
78
    build_huffman_codes(m->huff_size_ac_luminance,
79
                        m->huff_code_ac_luminance,
80
                        bits_ac_luminance,
81
                        val_ac_luminance);
82
    build_huffman_codes(m->huff_size_ac_chrominance,
83
                        m->huff_code_ac_chrominance,
84
                        bits_ac_chrominance,
85
                        val_ac_chrominance);
70
    ff_mjpeg_build_huffman_codes(m->huff_size_dc_luminance,
71
                                 m->huff_code_dc_luminance,
72
                                 ff_mjpeg_bits_dc_luminance,
73
                                 ff_mjpeg_val_dc_luminance);
74
    ff_mjpeg_build_huffman_codes(m->huff_size_dc_chrominance,
75
                                 m->huff_code_dc_chrominance,
76
                                 ff_mjpeg_bits_dc_chrominance,
77
                                 ff_mjpeg_val_dc_chrominance);
78
    ff_mjpeg_build_huffman_codes(m->huff_size_ac_luminance,
79
                                 m->huff_code_ac_luminance,
80
                                 ff_mjpeg_bits_ac_luminance,
81
                                 ff_mjpeg_val_ac_luminance);
82
    ff_mjpeg_build_huffman_codes(m->huff_size_ac_chrominance,
83
                                 m->huff_code_ac_chrominance,
84
                                 ff_mjpeg_bits_ac_chrominance,
85
                                 ff_mjpeg_val_ac_chrominance);
86 86

  
87 87
    s->mjpeg_ctx = m;
88 88
    return 0;
......
149 149
    ptr = pbBufPtr(p);
150 150
    put_bits(p, 16, 0); /* patched later */
151 151
    size = 2;
152
    size += put_huffman_table(s, 0, 0, bits_dc_luminance, val_dc_luminance);
153
    size += put_huffman_table(s, 0, 1, bits_dc_chrominance, val_dc_chrominance);
154

  
155
    size += put_huffman_table(s, 1, 0, bits_ac_luminance, val_ac_luminance);
156
    size += put_huffman_table(s, 1, 1, bits_ac_chrominance, val_ac_chrominance);
152
    size += put_huffman_table(s, 0, 0, ff_mjpeg_bits_dc_luminance,
153
                              ff_mjpeg_val_dc_luminance);
154
    size += put_huffman_table(s, 0, 1, ff_mjpeg_bits_dc_chrominance,
155
                              ff_mjpeg_val_dc_chrominance);
156

  
157
    size += put_huffman_table(s, 1, 0, ff_mjpeg_bits_ac_luminance,
158
                              ff_mjpeg_val_ac_luminance);
159
    size += put_huffman_table(s, 1, 1, ff_mjpeg_bits_ac_chrominance,
160
                              ff_mjpeg_val_ac_chrominance);
157 161
    ptr[0] = size >> 8;
158 162
    ptr[1] = size;
159 163
}

Also available in: Unified diff