summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libvdpau/dpb.c17
-rw-r--r--src/libvdpau/h264_parser.c16
-rw-r--r--src/libvdpau/vdpau_h264.c4
3 files changed, 8 insertions, 29 deletions
diff --git a/src/libvdpau/dpb.c b/src/libvdpau/dpb.c
index 0f5970ced..00dd1a580 100644
--- a/src/libvdpau/dpb.c
+++ b/src/libvdpau/dpb.c
@@ -42,8 +42,6 @@ struct decoded_picture* dpb_get_next_out_picture(struct dpb *dpb)
struct decoded_picture *pic = dpb->pictures;
struct decoded_picture *outpic = pic;
- printf("dpb used: %d\n", dpb->used);
-
if(dpb->used < MAX_DPB_SIZE)
return NULL;
@@ -102,7 +100,6 @@ struct decoded_picture* dpb_get_picture_by_ltidx(struct dpb *dpb,
int dpb_set_unused_ref_picture(struct dpb *dpb, uint32_t picnum)
{
struct decoded_picture *pic = dpb->pictures;
-printf("UNUSED 1\n");
if (pic != NULL)
do {
if (pic->nal->curr_pic_num == picnum) {
@@ -119,7 +116,6 @@ printf("UNUSED 1\n");
int dpb_set_unused_ref_picture_byltpn(struct dpb *dpb, uint32_t longterm_picnum)
{
struct decoded_picture *pic = dpb->pictures;
- printf("UNUSED 2\n");
if (pic != NULL)
do {
if (pic->nal->long_term_pic_num == longterm_picnum) {
@@ -136,7 +132,6 @@ int dpb_set_unused_ref_picture_byltpn(struct dpb *dpb, uint32_t longterm_picnum)
int dpb_set_unused_ref_picture_bylidx(struct dpb *dpb, uint32_t longterm_idx)
{
struct decoded_picture *pic = dpb->pictures;
- printf("UNUSED 3\n");
if (pic != NULL)
do {
if (pic->nal->long_term_frame_idx == longterm_idx) {
@@ -153,7 +148,6 @@ int dpb_set_unused_ref_picture_bylidx(struct dpb *dpb, uint32_t longterm_idx)
int dpb_set_unused_ref_picture_lidx_gt(struct dpb *dpb, uint32_t longterm_idx)
{
struct decoded_picture *pic = dpb->pictures;
- printf("UNUSED 4\n");
if (pic != NULL)
do {
if (pic->nal->long_term_frame_idx >= longterm_idx) {
@@ -174,11 +168,9 @@ int dpb_set_unused_ref_picture_lidx_gt(struct dpb *dpb, uint32_t longterm_idx)
int dpb_set_output_picture(struct dpb *dpb, struct decoded_picture *outpic)
{
struct decoded_picture *pic = dpb->pictures;
-printf("DPB set output pic\n");
if (pic != NULL)
do {
if (pic == outpic) {
- printf("DPB pic num %d output, refuse: %d\n", pic->nal->curr_pic_num, pic->used_for_reference);
pic->delayed_output = 0;
if(!pic->used_for_reference)
dpb_remove_picture(dpb, pic);
@@ -193,11 +185,10 @@ int dpb_remove_picture(struct dpb *dpb, struct decoded_picture *rempic)
{
struct decoded_picture *pic = dpb->pictures;
struct decoded_picture *last_pic = NULL;
-printf("DPB remove pic\n");
+
if (pic != NULL)
do {
if (pic == rempic) {
- printf("DPB found rempic\n");
// FIXME: free the picture....
if (last_pic != NULL)
@@ -206,7 +197,6 @@ printf("DPB remove pic\n");
dpb->pictures = pic->next;
free_decoded_picture(pic);
dpb->used--;
- printf("DPB Used: %d\n", dpb->used);
return 0;
}
@@ -241,13 +231,12 @@ int dpb_add_picture(struct dpb *dpb, struct decoded_picture *pic, uint32_t num_r
pic->next = dpb->pictures;
dpb->pictures = pic;
dpb->used++;
-printf("ADD: Used: %d\n", dpb->used);
+
if(dpb->used > num_ref_frames) {
do {
if(pic->used_for_reference) {
i++;
if(i>num_ref_frames) {
- printf("DPB REMOVE REF FRAME\n");
pic->used_for_reference = 0;
if(!pic->delayed_output)
dpb_remove_picture(dpb, pic);
@@ -306,8 +295,6 @@ void fill_vdpau_reference_list(struct dpb *dpb, VdpReferenceFrameH264 *reflist)
last_pic = pic;
} while ((pic = pic->next) != NULL && i < 16);
- printf("Used ref-frames: %d\n", i);
-
// fill all other frames with invalid handles
while(i < 16) {
reflist[i].bottom_is_reference = VDP_FALSE;
diff --git a/src/libvdpau/h264_parser.c b/src/libvdpau/h264_parser.c
index e5206a943..28f9f607f 100644
--- a/src/libvdpau/h264_parser.c
+++ b/src/libvdpau/h264_parser.c
@@ -156,10 +156,9 @@ int32_t read_exp_golomb_s(struct buf_reader *buf)
int parse_nal_header(struct buf_reader *buf, struct nal_parser *parser)
{
- if (buf->len < 1) {
- printf("ERROR: Empty buffer passed\n");
+ if (buf->len < 1)
return -1;
- }
+
int ret = -1;
struct nal_unit *nal = parser->current_nal;
@@ -828,7 +827,6 @@ void decode_ref_pic_marking(uint32_t memory_management_control_operation,
return;
if (memory_management_control_operation == 1) {
- printf("MMC 1\n");
// short-term -> unused for reference
uint32_t pic_num_x = nal->curr_pic_num
- (slc->dec_ref_pic_marking.difference_of_pic_nums_minus1 + 1);
@@ -844,7 +842,6 @@ void decode_ref_pic_marking(uint32_t memory_management_control_operation,
}
}
else if (memory_management_control_operation == 2) {
- printf("MMC 2\n");
// long-term -> unused for reference
struct decoded_picture* pic = dpb_get_picture_by_ltpn(dpb,
slc->dec_ref_pic_marking.long_term_pic_num);
@@ -860,7 +857,6 @@ void decode_ref_pic_marking(uint32_t memory_management_control_operation,
}
}
else if (memory_management_control_operation == 3) {
- printf("MMC 3\n");
// short-term -> long-term, set long-term frame index
uint32_t pic_num_x = nal->curr_pic_num
- (slc->dec_ref_pic_marking.difference_of_pic_nums_minus1 + 1);
@@ -886,7 +882,6 @@ void decode_ref_pic_marking(uint32_t memory_management_control_operation,
}
else if (memory_management_control_operation == 4) {
- printf("MMC 4\n");
// set max-long-term frame index,
// mark all long-term pictures with long-term frame idx
// greater max-long-term farme idx as unused for ref
@@ -897,16 +892,13 @@ void decode_ref_pic_marking(uint32_t memory_management_control_operation,
slc->dec_ref_pic_marking.max_long_term_frame_idx_plus1 - 1);
}
else if (memory_management_control_operation == 5) {
- printf("MMC 5\n");
// mark all ref pics as unused for reference,
// set max-long-term frame index = no long-term frame idxs
dpb_flush(dpb);
- printf("MMC RESET\n");
parser->pic_order_cnt_lsb = parser->prev_pic_order_cnt_lsb = 0;
parser->pic_order_cnt_msb = parser->prev_pic_order_cnt_msb = 0;
}
else if (memory_management_control_operation == 6) {
- printf("MMC 6\n");
// mark current picture as used for long-term ref,
// assing long-term frame idx to it
struct decoded_picture* pic = dpb_get_picture_by_ltidx(dpb,
@@ -1053,7 +1045,7 @@ int parse_frame(struct nal_parser *parser, uint8_t *inbuf, int inbuf_len,
parser->last_nal_res = parse_nal(prebuf+3, parser->prebuf_len-3, parser);
if (parser->last_nal_res == 1 && parser->buf_len > 0) {
- printf("Frame complete: %d bytes\n", parser->buf_len);
+ //printf("Frame complete: %d bytes\n", parser->buf_len);
*ret_buf = malloc(parser->buf_len);
xine_fast_memcpy(*ret_buf, parser->buf, parser->buf_len);
*ret_len = parser->buf_len;
@@ -1067,7 +1059,7 @@ int parse_frame(struct nal_parser *parser, uint8_t *inbuf, int inbuf_len,
parser->slice_cnt = 1;
/* this is a SLICE, keep it in the buffer */
- printf("slice %d size: %d\n", parser->slice_cnt-1, parser->prebuf_len);
+ //printf("slice %d size: %d\n", parser->slice_cnt-1, parser->prebuf_len);
xine_fast_memcpy(parser->buf + parser->buf_len, prebuf, parser->prebuf_len);
parser->buf_len += parser->prebuf_len;
parser->prebuf_len = 0;
diff --git a/src/libvdpau/vdpau_h264.c b/src/libvdpau/vdpau_h264.c
index fbbdbe205..a4446d109 100644
--- a/src/libvdpau/vdpau_h264.c
+++ b/src/libvdpau/vdpau_h264.c
@@ -310,7 +310,7 @@ static void vdpau_h264_decode_data (video_decoder_t *this_gen,
if(!this->decoder_started)
this->decoder_started = 1;
- dump_pictureinfo_h264(&pic);
+ //dump_pictureinfo_h264(&pic);
/*int i;
printf("Decode data: \n");
@@ -369,7 +369,6 @@ static void vdpau_h264_decode_data (video_decoder_t *this_gen,
if(!slc->field_pic_flag || !this->wait_for_bottom_field) {
decoded_pic = init_decoded_picture(this->nal_parser->current_nal, surface, img);
this->last_ref_pic = decoded_pic;
- printf("Add ref pic: %d\n", decoded_pic->nal->slc->frame_num);
decoded_pic->used_for_reference = 1;
dpb_add_picture(&(this->nal_parser->dpb), decoded_pic, sps->num_ref_frames);
} else if(slc->field_pic_flag && this->wait_for_bottom_field) {
@@ -403,6 +402,7 @@ static void vdpau_h264_decode_data (video_decoder_t *this_gen,
this->wait_for_bottom_field = 0;*/
+ printf("pts: %lld\n", buf->pts);
img->draw(img, this->stream);
this->wait_for_bottom_field = 0;