Mercurial > libavcodec.hg
comparison vc1.h @ 9732:c25359a56edf libavcodec
set pict_type in VC-1 parser, fix some timestamps problems
author | bcoudurier |
---|---|
date | Sat, 30 May 2009 00:09:00 +0000 |
parents | 48442253aac2 |
children | d580026275a1 |
comparison
equal
deleted
inserted
replaced
9731:5b1b3c4a1f17 | 9732:c25359a56edf |
---|---|
308 | 308 |
309 uint32_t *cbp_base, *cbp; | 309 uint32_t *cbp_base, *cbp; |
310 uint8_t bfraction_lut_index;///< Index for BFRACTION value (see Table 40, reproduced into ff_vc1_bfraction_lut[]) | 310 uint8_t bfraction_lut_index;///< Index for BFRACTION value (see Table 40, reproduced into ff_vc1_bfraction_lut[]) |
311 uint8_t broken_link; ///< Broken link flag (BROKEN_LINK syntax element) | 311 uint8_t broken_link; ///< Broken link flag (BROKEN_LINK syntax element) |
312 uint8_t closed_entry; ///< Closed entry point flag (CLOSED_ENTRY syntax element) | 312 uint8_t closed_entry; ///< Closed entry point flag (CLOSED_ENTRY syntax element) |
313 | |
314 int parse_only; ///< Context is used within parser | |
313 } VC1Context; | 315 } VC1Context; |
314 | 316 |
317 /** Find VC-1 marker in buffer | |
318 * @return position where next marker starts or end of buffer if no marker found | |
319 */ | |
320 static av_always_inline const uint8_t* find_next_marker(const uint8_t *src, const uint8_t *end) | |
321 { | |
322 uint32_t mrk = 0xFFFFFFFF; | |
323 | |
324 if(end-src < 4) return end; | |
325 while(src < end){ | |
326 mrk = (mrk << 8) | *src++; | |
327 if(IS_MARKER(mrk)) | |
328 return src-4; | |
329 } | |
330 return end; | |
331 } | |
332 | |
333 static av_always_inline int vc1_unescape_buffer(const uint8_t *src, int size, uint8_t *dst) | |
334 { | |
335 int dsize = 0, i; | |
336 | |
337 if(size < 4){ | |
338 for(dsize = 0; dsize < size; dsize++) *dst++ = *src++; | |
339 return size; | |
340 } | |
341 for(i = 0; i < size; i++, src++) { | |
342 if(src[0] == 3 && i >= 2 && !src[-1] && !src[-2] && i < size-1 && src[1] < 4) { | |
343 dst[dsize++] = src[1]; | |
344 src++; | |
345 i++; | |
346 } else | |
347 dst[dsize++] = *src; | |
348 } | |
349 return dsize; | |
350 } | |
351 | |
352 /** | |
353 * Decode Simple/Main Profiles sequence header | |
354 * @see Figure 7-8, p16-17 | |
355 * @param avctx Codec context | |
356 * @param gb GetBit context initialized from Codec context extra_data | |
357 * @return Status | |
358 */ | |
359 int vc1_decode_sequence_header(AVCodecContext *avctx, VC1Context *v, GetBitContext *gb); | |
360 | |
361 int vc1_decode_entry_point(AVCodecContext *avctx, VC1Context *v, GetBitContext *gb); | |
362 | |
363 int vc1_parse_frame_header (VC1Context *v, GetBitContext *gb); | |
364 int vc1_parse_frame_header_adv(VC1Context *v, GetBitContext *gb); | |
365 | |
315 #endif /* AVCODEC_VC1_H */ | 366 #endif /* AVCODEC_VC1_H */ |