comparison mpeg12.c @ 1880:56ccec0d08bd libavcodec

removing broken mpeg_decode_gop()
author michael
date Sat, 13 Mar 2004 22:01:32 +0000
parents d493ce1c4497
children 4bbe33eed9f0
comparison
equal deleted inserted replaced
1879:dd63cb7e5080 1880:56ccec0d08bd
2584 avctx->dtg_active_format = p[0] & 0x0f; 2584 avctx->dtg_active_format = p[0] & 0x0f;
2585 } 2585 }
2586 } 2586 }
2587 } 2587 }
2588 2588
2589 static void mpeg_decode_gop(AVCodecContext *avctx,
2590 const uint8_t *buf, int buf_size){
2591 Mpeg1Context *s1 = avctx->priv_data;
2592 MpegEncContext *s = &s1->mpeg_enc_ctx;
2593
2594 int drop_frame_flag;
2595 int time_code_hours, time_code_minutes;
2596 int time_code_seconds, time_code_pictures;
2597 int broken_link;
2598
2599 s->first_field = 0;
2600
2601 init_get_bits(&s->gb, buf, buf_size*8);
2602
2603 drop_frame_flag = get_bits1(&s->gb);
2604
2605 time_code_hours=get_bits(&s->gb,5);
2606 time_code_minutes = get_bits(&s->gb,6);
2607 skip_bits1(&s->gb);//marker bit
2608 time_code_seconds = get_bits(&s->gb,6);
2609 time_code_pictures = get_bits(&s->gb,6);
2610 /*broken_link indicate that after editing the
2611 reference frames of the first B-Frames after GOP I-Frame
2612 are missing (open gop)*/
2613 broken_link = get_bits1(&s->gb);
2614 if(broken_link == 1){
2615 // avcodec_flush_buffers(avctx);
2616 ff_mpeg_flush(avctx);
2617 }
2618 }
2619
2620 /** 2589 /**
2621 * finds the end of the current frame in the bitstream. 2590 * finds the end of the current frame in the bitstream.
2622 * @return the position of the first byte of the next frame, or -1 2591 * @return the position of the first byte of the next frame, or -1
2623 */ 2592 */
2624 static int mpeg1_find_frame_end(MpegEncContext *s, uint8_t *buf, int buf_size){ 2593 static int mpeg1_find_frame_end(MpegEncContext *s, uint8_t *buf, int buf_size){
2752 case USER_START_CODE: 2721 case USER_START_CODE:
2753 mpeg_decode_user_data(avctx, 2722 mpeg_decode_user_data(avctx,
2754 buf_ptr, input_size); 2723 buf_ptr, input_size);
2755 break; 2724 break;
2756 case GOP_START_CODE: 2725 case GOP_START_CODE:
2757 mpeg_decode_gop(avctx, buf_ptr, input_size); 2726 s2->first_field=0;
2758 break; 2727 break;
2759 default: 2728 default:
2760 if (start_code >= SLICE_MIN_START_CODE && 2729 if (start_code >= SLICE_MIN_START_CODE &&
2761 start_code <= SLICE_MAX_START_CODE) { 2730 start_code <= SLICE_MAX_START_CODE) {
2762 int mb_y= start_code - SLICE_MIN_START_CODE; 2731 int mb_y= start_code - SLICE_MIN_START_CODE;