comparison rpza.c @ 4364:05e932ddaaa9 libavcodec

rename BE/LE_8/16/32 to AV_RL/B_8/16/32
author alex
date Fri, 19 Jan 2007 22:12:59 +0000
parents c8c591fe26f8
children 66ef3690d108
comparison
equal deleted inserted replaced
4363:9b7662fa4905 4364:05e932ddaaa9
96 if (s->buf[stream_ptr] != 0xe1) 96 if (s->buf[stream_ptr] != 0xe1)
97 av_log(s->avctx, AV_LOG_ERROR, "First chunk byte is 0x%02x instead of 0xe1\n", 97 av_log(s->avctx, AV_LOG_ERROR, "First chunk byte is 0x%02x instead of 0xe1\n",
98 s->buf[stream_ptr]); 98 s->buf[stream_ptr]);
99 99
100 /* Get chunk size, ingnoring first byte */ 100 /* Get chunk size, ingnoring first byte */
101 chunk_size = BE_32(&s->buf[stream_ptr]) & 0x00FFFFFF; 101 chunk_size = AV_RB32(&s->buf[stream_ptr]) & 0x00FFFFFF;
102 stream_ptr += 4; 102 stream_ptr += 4;
103 103
104 /* If length mismatch use size from MOV file and try to decode anyway */ 104 /* If length mismatch use size from MOV file and try to decode anyway */
105 if (chunk_size != s->size) 105 if (chunk_size != s->size)
106 av_log(s->avctx, AV_LOG_ERROR, "MOV chunk size != encoded chunk size; using MOV chunk size\n"); 106 av_log(s->avctx, AV_LOG_ERROR, "MOV chunk size != encoded chunk size; using MOV chunk size\n");
138 } 138 }
139 break; 139 break;
140 140
141 /* Fill blocks with one color */ 141 /* Fill blocks with one color */
142 case 0xa0: 142 case 0xa0:
143 colorA = BE_16 (&s->buf[stream_ptr]); 143 colorA = AV_RB16 (&s->buf[stream_ptr]);
144 stream_ptr += 2; 144 stream_ptr += 2;
145 while (n_blocks--) { 145 while (n_blocks--) {
146 block_ptr = row_ptr + pixel_ptr; 146 block_ptr = row_ptr + pixel_ptr;
147 for (pixel_y = 0; pixel_y < 4; pixel_y++) { 147 for (pixel_y = 0; pixel_y < 4; pixel_y++) {
148 for (pixel_x = 0; pixel_x < 4; pixel_x++){ 148 for (pixel_x = 0; pixel_x < 4; pixel_x++){
155 } 155 }
156 break; 156 break;
157 157
158 /* Fill blocks with 4 colors */ 158 /* Fill blocks with 4 colors */
159 case 0xc0: 159 case 0xc0:
160 colorA = BE_16 (&s->buf[stream_ptr]); 160 colorA = AV_RB16 (&s->buf[stream_ptr]);
161 stream_ptr += 2; 161 stream_ptr += 2;
162 case 0x20: 162 case 0x20:
163 colorB = BE_16 (&s->buf[stream_ptr]); 163 colorB = AV_RB16 (&s->buf[stream_ptr]);
164 stream_ptr += 2; 164 stream_ptr += 2;
165 165
166 /* sort out the colors */ 166 /* sort out the colors */
167 color4[0] = colorB; 167 color4[0] = colorB;
168 color4[1] = 0; 168 color4[1] = 0;
207 block_ptr = row_ptr + pixel_ptr; 207 block_ptr = row_ptr + pixel_ptr;
208 for (pixel_y = 0; pixel_y < 4; pixel_y++) { 208 for (pixel_y = 0; pixel_y < 4; pixel_y++) {
209 for (pixel_x = 0; pixel_x < 4; pixel_x++){ 209 for (pixel_x = 0; pixel_x < 4; pixel_x++){
210 /* We already have color of upper left pixel */ 210 /* We already have color of upper left pixel */
211 if ((pixel_y != 0) || (pixel_x !=0)) { 211 if ((pixel_y != 0) || (pixel_x !=0)) {
212 colorA = BE_16 (&s->buf[stream_ptr]); 212 colorA = AV_RB16 (&s->buf[stream_ptr]);
213 stream_ptr += 2; 213 stream_ptr += 2;
214 } 214 }
215 pixels[block_ptr] = colorA; 215 pixels[block_ptr] = colorA;
216 block_ptr++; 216 block_ptr++;
217 } 217 }