1 |
|
/***************************************************************************** |
2 |
|
* |
3 |
|
* XVID MPEG4 Codec |
4 |
|
* - Image functions - header files |
5 |
|
* |
6 |
|
* This file is part of XviD, a free MPEG-4 video encoder/decoder |
7 |
|
* |
8 |
|
* XviD is free software; you can redistribute it and/or modify it |
9 |
|
* under the terms of the GNU General Public License as published by |
10 |
|
* the Free Software Foundation; either version 2 of the License, or |
11 |
|
* (at your option) any later version. |
12 |
|
* |
13 |
|
* This program is distributed in the hope that it will be useful, |
14 |
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 |
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 |
|
* GNU General Public License for more details. |
17 |
|
* |
18 |
|
* You should have received a copy of the GNU General Public License |
19 |
|
* along with this program; if not, write to the Free Software |
20 |
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
21 |
|
* |
22 |
|
* Under section 8 of the GNU General Public License, the copyright |
23 |
|
* holders of XVID explicitly forbid distribution in the following |
24 |
|
* countries: |
25 |
|
* |
26 |
|
* - Japan |
27 |
|
* - United States of America |
28 |
|
* |
29 |
|
* Linking XviD statically or dynamically with other modules is making a |
30 |
|
* combined work based on XviD. Thus, the terms and conditions of the |
31 |
|
* GNU General Public License cover the whole combination. |
32 |
|
* |
33 |
|
* As a special exception, the copyright holders of XviD give you |
34 |
|
* permission to link XviD with independent modules that communicate with |
35 |
|
* XviD solely through the VFW1.1 and DShow interfaces, regardless of the |
36 |
|
* license terms of these independent modules, and to copy and distribute |
37 |
|
* the resulting combined work under terms of your choice, provided that |
38 |
|
* every copy of the combined work is accompanied by a complete copy of |
39 |
|
* the source code of XviD (the version of XviD used to produce the |
40 |
|
* combined work), being distributed under the terms of the GNU General |
41 |
|
* Public License plus this exception. An independent module is a module |
42 |
|
* which is not derived from or based on XviD. |
43 |
|
* |
44 |
|
* Note that people who make modified versions of XviD are not obligated |
45 |
|
* to grant this special exception for their modified versions; it is |
46 |
|
* their choice whether to do so. The GNU General Public License gives |
47 |
|
* permission to release a modified version without this exception; this |
48 |
|
* exception also makes it possible to release a modified version which |
49 |
|
* carries forward this exception. |
50 |
|
* |
51 |
|
* $Id$ |
52 |
|
* |
53 |
|
****************************************************************************/ |
54 |
|
|
55 |
#ifndef _IMAGE_H_ |
#ifndef _IMAGE_H_ |
56 |
#define _IMAGE_H_ |
#define _IMAGE_H_ |
57 |
|
|
58 |
#include "../portab.h" |
#include "../portab.h" |
59 |
#include "colorspace.h" |
#include "colorspace.h" |
60 |
|
#include "../xvid.h" |
61 |
|
|
62 |
#define EDGE_SIZE 32 |
#define EDGE_SIZE 32 |
63 |
|
|
67 |
uint8_t * y; |
uint8_t * y; |
68 |
uint8_t * u; |
uint8_t * u; |
69 |
uint8_t * v; |
uint8_t * v; |
70 |
} IMAGE; |
} |
71 |
|
IMAGE; |
72 |
|
|
73 |
void init_image(uint32_t cpu_flags); |
void init_image(uint32_t cpu_flags); |
74 |
|
|
75 |
int32_t image_create(IMAGE * image, uint32_t edged_width, uint32_t edged_height); |
int32_t image_create(IMAGE * image, |
76 |
void image_destroy(IMAGE * image, uint32_t edged_width, uint32_t edged_height); |
uint32_t edged_width, |
77 |
|
uint32_t edged_height); |
78 |
void image_swap(IMAGE * image1, IMAGE * image2); |
void image_destroy(IMAGE * image, |
79 |
void image_copy(IMAGE *image1, IMAGE * image2, uint32_t edged_width, uint32_t height); |
uint32_t edged_width, |
80 |
void image_setedges(IMAGE * image, uint32_t edged_width, uint32_t edged_height, uint32_t width, uint32_t height, uint32_t interlacing); |
uint32_t edged_height); |
81 |
|
|
82 |
|
void image_swap(IMAGE * image1, |
83 |
|
IMAGE * image2); |
84 |
|
void image_copy(IMAGE * image1, |
85 |
|
IMAGE * image2, |
86 |
|
uint32_t edged_width, |
87 |
|
uint32_t height); |
88 |
|
void image_setedges(IMAGE * image, |
89 |
|
uint32_t edged_width, |
90 |
|
uint32_t edged_height, |
91 |
|
uint32_t width, |
92 |
|
uint32_t height); |
93 |
void image_interpolate(const IMAGE * refn, |
void image_interpolate(const IMAGE * refn, |
94 |
IMAGE * refh, IMAGE * refv, IMAGE * refhv, |
IMAGE * refh, |
95 |
uint32_t edged_width, uint32_t edged_height, uint32_t rounding); |
IMAGE * refv, |
96 |
|
IMAGE * refhv, |
97 |
float image_psnr(IMAGE *orig_image, IMAGE *recon_image, |
uint32_t edged_width, |
98 |
uint16_t stride, uint16_t width, uint16_t height); |
uint32_t edged_height, |
99 |
|
uint32_t rounding); |
100 |
|
|
101 |
int image_input(IMAGE * image, uint32_t width, int height, uint32_t edged_width, |
float image_psnr(IMAGE * orig_image, |
102 |
uint8_t * src, int csp); |
IMAGE * recon_image, |
103 |
|
uint16_t stride, |
104 |
int image_output(IMAGE * image, uint32_t width, int height, uint32_t edged_width, |
uint16_t width, |
105 |
uint8_t * dst, uint32_t dst_stride, int csp); |
uint16_t height); |
106 |
|
|
107 |
|
|
108 |
|
int image_input(IMAGE * image, |
109 |
|
uint32_t width, |
110 |
|
int height, |
111 |
|
uint32_t edged_width, |
112 |
|
uint8_t * src, |
113 |
|
int csp); |
114 |
|
|
115 |
|
int image_output(IMAGE * image, |
116 |
|
uint32_t width, |
117 |
|
int height, |
118 |
|
uint32_t edged_width, |
119 |
|
uint8_t * dst, |
120 |
|
uint32_t dst_stride, |
121 |
|
int csp); |
122 |
|
|
123 |
|
|
124 |
|
|
128 |
const uint32_t height, |
const uint32_t height, |
129 |
char * filename); |
char * filename); |
130 |
|
|
131 |
float image_mad(const IMAGE * img1, const IMAGE * img2, uint32_t stride, |
float image_mad(const IMAGE * img1, |
132 |
uint32_t width, uint32_t height); |
const IMAGE * img2, |
133 |
|
uint32_t stride, |
134 |
|
uint32_t width, |
135 |
|
uint32_t height); |
136 |
|
|
137 |
|
void |
138 |
|
output_slice(IMAGE * cur, int edged_width, int width, XVID_DEC_PICTURE* out_frm, int mbx, int mby,int mbl); |
139 |
|
|
140 |
#endif /* _IMAGE_H_ */ |
#endif /* _IMAGE_H_ */ |