Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Xiph.Org
aom-rav1e
Commits
a0befb93
Commit
a0befb93
authored
Oct 01, 2014
by
Alex Converse
Committed by
Deb Mukherjee
Oct 02, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix subsampling check for images 1 pixel wide/tall
Change-Id: I0e262ede7eb4a4ae0c86181922d744e542e93350
parent
6a0976dc
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
11 deletions
+19
-11
vp9/decoder/vp9_decodeframe.c
vp9/decoder/vp9_decodeframe.c
+6
-2
vp9/encoder/vp9_encoder.c
vp9/encoder/vp9_encoder.c
+2
-2
vp9/vp9_iface_common.h
vp9/vp9_iface_common.h
+7
-7
vpx_scale/generic/yv12config.c
vpx_scale/generic/yv12config.c
+2
-0
vpx_scale/yv12config.h
vpx_scale/yv12config.h
+2
-0
No files found.
vp9/decoder/vp9_decodeframe.c
View file @
a0befb93
...
...
@@ -735,6 +735,8 @@ static void setup_frame_size(VP9_COMMON *cm, struct vp9_read_bit_buffer *rb) {
vpx_internal_error
(
&
cm
->
error
,
VPX_CODEC_MEM_ERROR
,
"Failed to allocate frame buffer"
);
}
cm
->
frame_bufs
[
cm
->
new_fb_idx
].
buf
.
subsampling_x
=
cm
->
subsampling_x
;
cm
->
frame_bufs
[
cm
->
new_fb_idx
].
buf
.
subsampling_y
=
cm
->
subsampling_y
;
cm
->
frame_bufs
[
cm
->
new_fb_idx
].
buf
.
bit_depth
=
(
unsigned
int
)
cm
->
bit_depth
;
}
...
...
@@ -787,8 +789,8 @@ static void setup_frame_size_with_refs(VP9_COMMON *cm,
RefBuffer
*
const
ref_frame
=
&
cm
->
frame_refs
[
i
];
if
(
!
valid_ref_frame_img_fmt
(
ref_frame
->
buf
->
bit_depth
,
ref_frame
->
buf
->
uv_crop_width
<
ref_frame
->
buf
->
y_crop_width
,
ref_frame
->
buf
->
uv_crop_height
<
ref_frame
->
buf
->
y_crop_height
,
ref_frame
->
buf
->
subsampling_x
,
ref_frame
->
buf
->
subsampling_y
,
cm
->
bit_depth
,
cm
->
subsampling_x
,
cm
->
subsampling_y
))
...
...
@@ -811,6 +813,8 @@ static void setup_frame_size_with_refs(VP9_COMMON *cm,
vpx_internal_error
(
&
cm
->
error
,
VPX_CODEC_MEM_ERROR
,
"Failed to allocate frame buffer"
);
}
cm
->
frame_bufs
[
cm
->
new_fb_idx
].
buf
.
subsampling_x
=
cm
->
subsampling_x
;
cm
->
frame_bufs
[
cm
->
new_fb_idx
].
buf
.
subsampling_y
=
cm
->
subsampling_y
;
cm
->
frame_bufs
[
cm
->
new_fb_idx
].
buf
.
bit_depth
=
(
unsigned
int
)
cm
->
bit_depth
;
}
...
...
vp9/encoder/vp9_encoder.c
View file @
a0befb93
...
...
@@ -3276,8 +3276,8 @@ int vp9_receive_raw_frame(VP9_COMP *cpi, unsigned int frame_flags,
VP9_COMMON
*
cm
=
&
cpi
->
common
;
struct
vpx_usec_timer
timer
;
int
res
=
0
;
const
int
subsampling_x
=
sd
->
uv_width
<
sd
->
y_width
;
const
int
subsampling_y
=
sd
->
uv_height
<
sd
->
y_height
;
const
int
subsampling_x
=
sd
->
subsampling_x
;
const
int
subsampling_y
=
sd
->
subsampling_y
;
#if CONFIG_VP9_HIGHBITDEPTH
const
int
use_highbitdepth
=
sd
->
flags
&
YV12_FLAG_HIGHBITDEPTH
;
check_initial_width
(
cpi
,
use_highbitdepth
,
subsampling_x
,
subsampling_y
);
...
...
vp9/vp9_iface_common.h
View file @
a0befb93
...
...
@@ -16,11 +16,9 @@ static void yuvconfig2image(vpx_image_t *img, const YV12_BUFFER_CONFIG *yv12,
* the Y, U, and V planes, nor other alignment adjustments that
* might be representable by a YV12_BUFFER_CONFIG, so we just
* initialize all the fields.*/
const
int
ss_x
=
yv12
->
uv_crop_width
<
yv12
->
y_crop_width
;
const
int
ss_y
=
yv12
->
uv_crop_height
<
yv12
->
y_crop_height
;
int
bps
;
if
(
!
ss
_y
)
{
if
(
!
ss
_x
)
{
if
(
!
yv12
->
subsampling
_y
)
{
if
(
!
yv12
->
subsampling
_x
)
{
img
->
fmt
=
VPX_IMG_FMT_I444
;
bps
=
24
;
}
else
{
...
...
@@ -28,7 +26,7 @@ static void yuvconfig2image(vpx_image_t *img, const YV12_BUFFER_CONFIG *yv12,
bps
=
16
;
}
}
else
{
if
(
!
ss
_x
)
{
if
(
!
yv12
->
subsampling
_x
)
{
img
->
fmt
=
VPX_IMG_FMT_I440
;
bps
=
16
;
}
else
{
...
...
@@ -41,8 +39,8 @@ static void yuvconfig2image(vpx_image_t *img, const YV12_BUFFER_CONFIG *yv12,
img
->
h
=
ALIGN_POWER_OF_TWO
(
yv12
->
y_height
+
2
*
VP9_ENC_BORDER_IN_PIXELS
,
3
);
img
->
d_w
=
yv12
->
y_crop_width
;
img
->
d_h
=
yv12
->
y_crop_height
;
img
->
x_chroma_shift
=
ss
_x
;
img
->
y_chroma_shift
=
ss
_y
;
img
->
x_chroma_shift
=
yv12
->
subsampling
_x
;
img
->
y_chroma_shift
=
yv12
->
subsampling
_y
;
img
->
planes
[
VPX_PLANE_Y
]
=
yv12
->
y_buffer
;
img
->
planes
[
VPX_PLANE_U
]
=
yv12
->
u_buffer
;
img
->
planes
[
VPX_PLANE_V
]
=
yv12
->
v_buffer
;
...
...
@@ -118,6 +116,8 @@ static vpx_codec_err_t image2yuvconfig(const vpx_image_t *img,
#else
yv12
->
border
=
(
img
->
stride
[
VPX_PLANE_Y
]
-
img
->
w
)
/
2
;
#endif // CONFIG_VP9_HIGHBITDEPTH
yv12
->
subsampling_x
=
img
->
x_chroma_shift
;
yv12
->
subsampling_y
=
img
->
y_chroma_shift
;
return
VPX_CODEC_OK
;
}
...
...
vpx_scale/generic/yv12config.c
View file @
a0befb93
...
...
@@ -242,6 +242,8 @@ int vp9_realloc_frame_buffer(YV12_BUFFER_CONFIG *ybf,
ybf
->
border
=
border
;
ybf
->
frame_size
=
(
int
)
frame_size
;
ybf
->
subsampling_x
=
ss_x
;
ybf
->
subsampling_y
=
ss_y
;
#if CONFIG_VP9_HIGHBITDEPTH
if
(
use_highbitdepth
)
{
...
...
vpx_scale/yv12config.h
View file @
a0befb93
...
...
@@ -51,6 +51,8 @@ typedef struct yv12_buffer_config {
int
buffer_alloc_sz
;
int
border
;
int
frame_size
;
int
subsampling_x
;
int
subsampling_y
;
unsigned
int
bit_depth
;
int
corrupted
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment