xine-lib  1.2.9
dpb.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008 Julian Scheel
3  *
4  * This file is part of xine, a free video player.
5  *
6  * xine is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * xine is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
19  *
20  * dpb.h: Decoded Picture Buffer
21  */
22 
23 #ifndef DPB_H_
24 #define DPB_H_
25 
26 #define MAX_DPB_COUNT 16
27 
28 #include "nal.h"
29 #include "cpb.h"
30 #include <xine/video_out.h>
31 #include <xine/list.h>
32 
33 #define USED_FOR_REF (top_is_reference || bottom_is_reference)
34 
42  vo_frame_t *img; /* this is the image we block, to make sure
43  * the surface is not double-used */
44 
51 
52  int32_t frame_num_wrap;
53 
56 
57  uint32_t lock_counter;
58 };
59 
60 static struct decoded_picture* init_decoded_picture(struct coded_picture *cpic,
61  vo_frame_t *img);
62 static void release_decoded_picture(struct decoded_picture *pic);
63 static void lock_decoded_picture(struct decoded_picture *pic);
64 static void decoded_pic_check_reference(struct decoded_picture *pic);
65 static void decoded_pic_add_field(struct decoded_picture *pic,
66  struct coded_picture *cpic);
67 
68 
75 /* Decoded Picture Buffer */
76 struct dpb {
79 
82 };
83 
84 static struct dpb* create_dpb(void);
85 static void release_dpb(struct dpb *dpb);
86 
93 static int dpb_total_frames(struct dpb *dpb);
94 
95 static struct decoded_picture* dpb_get_next_out_picture(struct dpb *dpb, int do_flush);
96 
97 static struct decoded_picture* dpb_get_picture(struct dpb *dpb, uint32_t picnum);
98 static struct decoded_picture* dpb_get_picture_by_ltpn(struct dpb *dpb, uint32_t longterm_picnum);
99 static struct decoded_picture* dpb_get_picture_by_ltidx(struct dpb *dpb, uint32_t longterm_idx);
100 
101 static int dpb_set_unused_ref_picture_byltpn(struct dpb *dpb, uint32_t longterm_picnum);
102 static int dpb_set_unused_ref_picture_bylidx(struct dpb *dpb, uint32_t longterm_idx);
103 static int dpb_set_unused_ref_picture_lidx_gt(struct dpb *dpb, int32_t longterm_idx);
104 
105 static int dpb_unmark_picture_delayed(struct dpb *dpb, struct decoded_picture *pic);
106 static int dpb_unmark_reference_picture(struct dpb *dpb, struct decoded_picture *pic);
107 
108 static int dpb_add_picture(struct dpb *dpb, struct decoded_picture *pic, uint32_t num_ref_frames);
109 static int dpb_flush(struct dpb *dpb);
110 static void dpb_free_all(struct dpb *dpb);
111 static void dpb_clear_all_pts(struct dpb *dpb);
112 
113 static int fill_vdpau_reference_list(struct dpb *dpb, VdpReferenceFrameH264 *reflist);
114 
115 static int dp_top_field_first(struct decoded_picture *decoded_pic);
116 
117 #endif /* DPB_H_ */
int max_dpb_frames
Definition: dpb.h:81
struct coded_picture * coded_pic[2]
Definition: dpb.h:50
int32_t frame_num_wrap
Definition: dpb.h:52
uint32_t lock_counter
Definition: dpb.h:57
vo_frame_t * img
Definition: dpb.h:42
static int dpb_unmark_reference_picture(struct dpb *dpb, struct decoded_picture *pic)
static void release_dpb(struct dpb *dpb)
static int dpb_set_unused_ref_picture_bylidx(struct dpb *dpb, uint32_t longterm_idx)
xine_list_t * reference_list
Definition: dpb.h:77
static void release_decoded_picture(struct decoded_picture *pic)
static int dp_top_field_first(struct decoded_picture *decoded_pic)
static struct decoded_picture * init_decoded_picture(struct coded_picture *cpic, vo_frame_t *img)
static int fill_vdpau_reference_list(struct dpb *dpb, VdpReferenceFrameH264 *reflist)
static void decoded_pic_add_field(struct decoded_picture *pic, struct coded_picture *cpic)
static void dpb_free_all(struct dpb *dpb)
static struct decoded_picture * dpb_get_picture_by_ltpn(struct dpb *dpb, uint32_t longterm_picnum)
static struct decoded_picture * dpb_get_picture_by_ltidx(struct dpb *dpb, uint32_t longterm_idx)
static int dpb_total_frames(struct dpb *dpb)
uint8_t top_is_reference
Definition: dpb.h:54
static int dpb_set_unused_ref_picture_lidx_gt(struct dpb *dpb, int32_t longterm_idx)
xine_list_t * output_list
Definition: dpb.h:78
static void lock_decoded_picture(struct decoded_picture *pic)
Definition: list.c:51
Definition: video_out.h:60
static struct dpb * create_dpb(void)
Definition: dpb.h:41
static int dpb_add_picture(struct dpb *dpb, struct decoded_picture *pic, uint32_t num_ref_frames)
static int dpb_set_unused_ref_picture_byltpn(struct dpb *dpb, uint32_t longterm_picnum)
Definition: dpb.c:319
static void decoded_pic_check_reference(struct decoded_picture *pic)
static struct decoded_picture * dpb_get_next_out_picture(struct dpb *dpb, int do_flush)
uint8_t bottom_is_reference
Definition: dpb.h:55
int max_reorder_frames
Definition: dpb.h:80
static void dpb_clear_all_pts(struct dpb *dpb)
static struct decoded_picture * dpb_get_picture(struct dpb *dpb, uint32_t picnum)
Definition: dpb.h:76
static int dpb_unmark_picture_delayed(struct dpb *dpb, struct decoded_picture *pic)
Definition: cpb.h:35
static int dpb_flush(struct dpb *dpb)