comparison roqvideo.c @ 5067:6166fbf375cc libavcodec

Remove duplicate bytestream functions
author ramiro
date Wed, 23 May 2007 14:55:13 +0000
parents f99e40a7155b
children 4f36b52179d1
comparison
equal deleted inserted replaced
5066:27afc3835257 5067:6166fbf375cc
30 #include <stdlib.h> 30 #include <stdlib.h>
31 #include <string.h> 31 #include <string.h>
32 #include <unistd.h> 32 #include <unistd.h>
33 33
34 #include "avcodec.h" 34 #include "avcodec.h"
35 #include "bytestream.h"
35 #include "dsputil.h" 36 #include "dsputil.h"
36 37
37 typedef struct { 38 typedef struct {
38 unsigned char y0, y1, y2, y3, u, v; 39 unsigned char y0, y1, y2, y3, u, v;
39 } roq_cell; 40 } roq_cell;
75 #define RoQ_ID_FCC 0x01 76 #define RoQ_ID_FCC 0x01
76 #define RoQ_ID_SLD 0x02 77 #define RoQ_ID_SLD 0x02
77 #define RoQ_ID_CCC 0x03 78 #define RoQ_ID_CCC 0x03
78 79
79 #define get_byte(in_buffer) *(in_buffer++) 80 #define get_byte(in_buffer) *(in_buffer++)
80 #define get_word(in_buffer) ((unsigned short)(in_buffer += 2, \
81 (in_buffer[-1] << 8 | in_buffer[-2])))
82 #define get_long(in_buffer) ((unsigned long)(in_buffer += 4, \
83 (in_buffer[-1] << 24 | in_buffer[-2] << 16 | in_buffer[-3] << 8 | in_buffer[-4])))
84 81
85 82
86 static void apply_vector_2x2(RoqContext *ri, int x, int y, roq_cell *cell) 83 static void apply_vector_2x2(RoqContext *ri, int x, int y, roq_cell *cell)
87 { 84 {
88 unsigned char *yptr; 85 unsigned char *yptr;
291 roq_qcell *qcell; 288 roq_qcell *qcell;
292 unsigned char *buf = ri->buf; 289 unsigned char *buf = ri->buf;
293 unsigned char *buf_end = ri->buf + ri->size; 290 unsigned char *buf_end = ri->buf + ri->size;
294 291
295 while (buf < buf_end) { 292 while (buf < buf_end) {
296 chunk_id = get_word(buf); 293 chunk_id = bytestream_get_le16(&buf);
297 chunk_size = get_long(buf); 294 chunk_size = bytestream_get_le32(&buf);
298 chunk_arg = get_word(buf); 295 chunk_arg = bytestream_get_le16(&buf);
299 296
300 if(chunk_id == RoQ_QUAD_VQ) 297 if(chunk_id == RoQ_QUAD_VQ)
301 break; 298 break;
302 if(chunk_id == RoQ_QUAD_CODEBOOK) { 299 if(chunk_id == RoQ_QUAD_CODEBOOK) {
303 if((nv1 = chunk_arg >> 8) == 0) 300 if((nv1 = chunk_arg >> 8) == 0)