comparison rtjpeg.c @ 6298:c8ec0c985df8 libavcodec

Add some const keywords in rtjpeg decoder
author reimar
date Fri, 01 Feb 2008 16:20:27 +0000
parents e283c82e10aa
children be4783347fbe
comparison
equal deleted inserted replaced
6297:1b91ce6c758c 6298:c8ec0c985df8
41 * 41 *
42 * Note: GetBitContext is used to make the code simpler, since all data is 42 * Note: GetBitContext is used to make the code simpler, since all data is
43 * aligned this could be done faster in a different way, e.g. as it is done 43 * aligned this could be done faster in a different way, e.g. as it is done
44 * in MPlayer libmpcodecs/native/RTjpegN.c 44 * in MPlayer libmpcodecs/native/RTjpegN.c
45 */ 45 */
46 static inline int get_block(GetBitContext *gb, DCTELEM *block, uint8_t *scan, 46 static inline int get_block(GetBitContext *gb, DCTELEM *block, const uint8_t *scan,
47 uint32_t *quant) { 47 const uint32_t *quant) {
48 int coeff, i, n; 48 int coeff, i, n;
49 int8_t ac; 49 int8_t ac;
50 uint8_t dc = get_bits(gb, 8); 50 uint8_t dc = get_bits(gb, 8);
51 51
52 // block not coded 52 // block not coded
95 * \param buf buffer containing input data 95 * \param buf buffer containing input data
96 * \param buf_size length of input data in bytes 96 * \param buf_size length of input data in bytes
97 * \return number of bytes consumed from the input buffer 97 * \return number of bytes consumed from the input buffer
98 */ 98 */
99 int rtjpeg_decode_frame_yuv420(RTJpegContext *c, AVFrame *f, 99 int rtjpeg_decode_frame_yuv420(RTJpegContext *c, AVFrame *f,
100 uint8_t *buf, int buf_size) { 100 const uint8_t *buf, int buf_size) {
101 DECLARE_ALIGNED_16(DCTELEM, block[64]); 101 DECLARE_ALIGNED_16(DCTELEM, block[64]);
102 GetBitContext gb; 102 GetBitContext gb;
103 int w = c->w / 16, h = c->h / 16; 103 int w = c->w / 16, h = c->h / 16;
104 int x, y; 104 int x, y;
105 uint8_t *y1 = f->data[0], *y2 = f->data[0] + 8 * f->linesize[0]; 105 uint8_t *y1 = f->data[0], *y2 = f->data[0] + 8 * f->linesize[0];
145 * \param lquant luma quantization table to use 145 * \param lquant luma quantization table to use
146 * \param cquant chroma quantization table to use 146 * \param cquant chroma quantization table to use
147 */ 147 */
148 void rtjpeg_decode_init(RTJpegContext *c, DSPContext *dsp, 148 void rtjpeg_decode_init(RTJpegContext *c, DSPContext *dsp,
149 int width, int height, 149 int width, int height,
150 uint32_t *lquant, uint32_t *cquant) { 150 const uint32_t *lquant, const uint32_t *cquant) {
151 int i; 151 int i;
152 c->dsp = dsp; 152 c->dsp = dsp;
153 for (i = 0; i < 64; i++) { 153 for (i = 0; i < 64; i++) {
154 int z = ff_zigzag_direct[i]; 154 int z = ff_zigzag_direct[i];
155 int p = c->dsp->idct_permutation[i]; 155 int p = c->dsp->idct_permutation[i];