Mercurial > libavcodec.hg
comparison h264.c @ 2979:bfabfdf9ce55 libavcodec
COSMETICS: tabs --> spaces, some prettyprinting
author | diego |
---|---|
date | Thu, 22 Dec 2005 01:10:11 +0000 |
parents | 1c22981c3498 |
children | b52d8ee430f6 |
comparison
equal
deleted
inserted
replaced
2978:403183bbb505 | 2979:bfabfdf9ce55 |
---|---|
145 */ | 145 */ |
146 typedef struct H264Context{ | 146 typedef struct H264Context{ |
147 MpegEncContext s; | 147 MpegEncContext s; |
148 int nal_ref_idc; | 148 int nal_ref_idc; |
149 int nal_unit_type; | 149 int nal_unit_type; |
150 #define NAL_SLICE 1 | 150 #define NAL_SLICE 1 |
151 #define NAL_DPA 2 | 151 #define NAL_DPA 2 |
152 #define NAL_DPB 3 | 152 #define NAL_DPB 3 |
153 #define NAL_DPC 4 | 153 #define NAL_DPC 4 |
154 #define NAL_IDR_SLICE 5 | 154 #define NAL_IDR_SLICE 5 |
155 #define NAL_SEI 6 | 155 #define NAL_SEI 6 |
156 #define NAL_SPS 7 | 156 #define NAL_SPS 7 |
157 #define NAL_PPS 8 | 157 #define NAL_PPS 8 |
158 #define NAL_AUD 9 | 158 #define NAL_AUD 9 |
159 #define NAL_END_SEQUENCE 10 | 159 #define NAL_END_SEQUENCE 10 |
160 #define NAL_END_STREAM 11 | 160 #define NAL_END_STREAM 11 |
161 #define NAL_FILLER_DATA 12 | 161 #define NAL_FILLER_DATA 12 |
162 #define NAL_SPS_EXT 13 | 162 #define NAL_SPS_EXT 13 |
163 #define NAL_AUXILIARY_SLICE 19 | 163 #define NAL_AUXILIARY_SLICE 19 |
1459 */ | 1459 */ |
1460 static uint8_t *decode_nal(H264Context *h, uint8_t *src, int *dst_length, int *consumed, int length){ | 1460 static uint8_t *decode_nal(H264Context *h, uint8_t *src, int *dst_length, int *consumed, int length){ |
1461 int i, si, di; | 1461 int i, si, di; |
1462 uint8_t *dst; | 1462 uint8_t *dst; |
1463 | 1463 |
1464 // src[0]&0x80; //forbidden bit | 1464 // src[0]&0x80; //forbidden bit |
1465 h->nal_ref_idc= src[0]>>5; | 1465 h->nal_ref_idc= src[0]>>5; |
1466 h->nal_unit_type= src[0]&0x1F; | 1466 h->nal_unit_type= src[0]&0x1F; |
1467 | 1467 |
1468 src++; length--; | 1468 src++; length--; |
1469 #if 0 | 1469 #if 0 |
7543 case NAL_END_STREAM: | 7543 case NAL_END_STREAM: |
7544 case NAL_FILLER_DATA: | 7544 case NAL_FILLER_DATA: |
7545 case NAL_SPS_EXT: | 7545 case NAL_SPS_EXT: |
7546 case NAL_AUXILIARY_SLICE: | 7546 case NAL_AUXILIARY_SLICE: |
7547 break; | 7547 break; |
7548 default: | 7548 default: |
7549 av_log(avctx, AV_LOG_ERROR, "Unknown NAL code: %d\n", h->nal_unit_type); | 7549 av_log(avctx, AV_LOG_ERROR, "Unknown NAL code: %d\n", h->nal_unit_type); |
7550 } | 7550 } |
7551 } | 7551 } |
7552 | 7552 |
7553 if(!s->current_picture_ptr) return buf_index; //no frame | 7553 if(!s->current_picture_ptr) return buf_index; //no frame |
7554 | 7554 |