Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Yushin Cho
aom-rav1e
Commits
58a54b20
Commit
58a54b20
authored
Sep 30, 2014
by
Deb Mukherjee
Committed by
Gerrit Code Review
Sep 30, 2014
Browse files
Merge "Misc. high-bit-depth fixes"
parents
96b0cfbb
40479dfe
Changes
3
Hide whitespace changes
Inline
Side-by-side
vp9/encoder/vp9_encoder.c
View file @
58a54b20
...
...
@@ -1676,6 +1676,10 @@ VP9_COMP *vp9_create_compressor(VP9EncoderConfig *oxcf) {
vp9_sub_pixel_avg_variance4x4
,
vp9_sad4x4x3
,
vp9_sad4x4x8
,
vp9_sad4x4x4d
)
#if CONFIG_VP9_HIGHBITDEPTH
highbd_set_var_fns
(
cpi
);
#endif
/* vp9_init_quantizer() is first called here. Add check in
* vp9_frame_init_quantizer() so that vp9_init_quantizer is only
* called later when needed. This will avoid unnecessary calls of
...
...
vp9/vp9_cx_iface.c
View file @
58a54b20
...
...
@@ -274,27 +274,47 @@ static vpx_codec_err_t validate_config(vpx_codec_alg_priv_t *ctx,
}
#if !CONFIG_VP9_HIGHBITDEPTH
if
(
cfg
->
g_profile
>
(
unsigned
int
)
PROFILE_1
)
if
(
cfg
->
g_profile
>
(
unsigned
int
)
PROFILE_1
)
{
ERROR
(
"Profile > 1 not supported in this build configuration"
);
}
#endif
if
(
cfg
->
g_profile
<=
(
unsigned
int
)
PROFILE_1
&&
extra_
cfg
->
bit_depth
>
VPX_BITS_8
)
cfg
->
g_
bit_depth
>
VPX_BITS_8
)
{
ERROR
(
"Codec high bit-depth not supported in profile < 2"
);
}
if
(
cfg
->
g_profile
<=
(
unsigned
int
)
PROFILE_1
&&
cfg
->
g_input_bit_depth
>
8
)
{
ERROR
(
"Source high bit-depth not supported in profile < 2"
);
}
if
(
cfg
->
g_profile
>
(
unsigned
int
)
PROFILE_1
&&
extra_
cfg
->
bit_depth
==
VPX_BITS_8
)
cfg
->
g_
bit_depth
==
VPX_BITS_8
)
{
ERROR
(
"Codec bit-depth 8 not supported in profile > 1"
);
}
return
VPX_CODEC_OK
;
}
static
vpx_codec_err_t
validate_img
(
vpx_codec_alg_priv_t
*
ctx
,
const
vpx_image_t
*
img
)
{
switch
(
img
->
fmt
)
{
case
VPX_IMG_FMT_YV12
:
case
VPX_IMG_FMT_I420
:
case
VPX_IMG_FMT_I42016
:
break
;
case
VPX_IMG_FMT_I422
:
case
VPX_IMG_FMT_I444
:
if
(
ctx
->
cfg
.
g_profile
!=
(
unsigned
int
)
PROFILE_1
)
{
ERROR
(
"Invalid image format. I422, I444 images are "
"not supported in profile."
);
}
break
;
case
VPX_IMG_FMT_I42216
:
case
VPX_IMG_FMT_I44416
:
if
(
ctx
->
cfg
.
g_profile
!=
(
unsigned
int
)
PROFILE_1
&&
ctx
->
cfg
.
g_profile
!=
(
unsigned
int
)
PROFILE_3
)
{
ERROR
(
"Invalid image format. 16-bit I422, I444 images are "
"not supported in profile."
);
}
break
;
default:
ERROR
(
"Invalid image format. Only YV12, I420, I422, I444 images are "
...
...
@@ -330,7 +350,7 @@ static vpx_codec_err_t set_encoder_config(
oxcf
->
profile
=
cfg
->
g_profile
;
oxcf
->
width
=
cfg
->
g_w
;
oxcf
->
height
=
cfg
->
g_h
;
oxcf
->
bit_depth
=
extra_
cfg
->
bit_depth
;
oxcf
->
bit_depth
=
cfg
->
g_
bit_depth
;
oxcf
->
input_bit_depth
=
cfg
->
g_input_bit_depth
;
// guess a frame rate if out of whack, use 30
oxcf
->
init_framerate
=
(
double
)
cfg
->
g_timebase
.
den
/
cfg
->
g_timebase
.
num
;
...
...
vpx/src/vpx_image.c
View file @
58a54b20
...
...
@@ -110,6 +110,7 @@ static vpx_image_t *img_alloc_helper(vpx_image_t *img,
case
VPX_IMG_FMT_YV12
:
case
VPX_IMG_FMT_VPXI420
:
case
VPX_IMG_FMT_VPXYV12
:
case
VPX_IMG_FMT_I42016
:
ycs
=
1
;
break
;
default:
...
...
@@ -209,39 +210,40 @@ int vpx_img_set_rect(vpx_image_t *img,
img
->
planes
[
VPX_PLANE_PACKED
]
=
img
->
img_data
+
x
*
img
->
bps
/
8
+
y
*
img
->
stride
[
VPX_PLANE_PACKED
];
}
else
{
const
int
bytes_per_sample
=
(
img
->
fmt
&
VPX_IMG_FMT_HIGHBITDEPTH
)
?
2
:
1
;
data
=
img
->
img_data
;
if
(
img
->
fmt
&
VPX_IMG_FMT_HAS_ALPHA
)
{
img
->
planes
[
VPX_PLANE_ALPHA
]
=
data
+
x
+
y
*
img
->
stride
[
VPX_PLANE_ALPHA
];
data
+
x
*
bytes_per_sample
+
y
*
img
->
stride
[
VPX_PLANE_ALPHA
];
data
+=
img
->
h
*
img
->
stride
[
VPX_PLANE_ALPHA
];
}
img
->
planes
[
VPX_PLANE_Y
]
=
data
+
x
+
y
*
img
->
stride
[
VPX_PLANE_Y
];
img
->
planes
[
VPX_PLANE_Y
]
=
data
+
x
*
bytes_per_sample
+
y
*
img
->
stride
[
VPX_PLANE_Y
];
data
+=
img
->
h
*
img
->
stride
[
VPX_PLANE_Y
];
if
(
!
(
img
->
fmt
&
VPX_IMG_FMT_UV_FLIP
))
{
img
->
planes
[
VPX_PLANE_U
]
=
data
+
(
x
>>
img
->
x_chroma_shift
)
+
(
y
>>
img
->
y_chroma_shift
)
*
img
->
stride
[
VPX_PLANE_U
];
img
->
planes
[
VPX_PLANE_U
]
=
data
+
(
x
>>
img
->
x_chroma_shift
)
*
bytes_per_sample
+
(
y
>>
img
->
y_chroma_shift
)
*
img
->
stride
[
VPX_PLANE_U
];
data
+=
(
img
->
h
>>
img
->
y_chroma_shift
)
*
img
->
stride
[
VPX_PLANE_U
];
img
->
planes
[
VPX_PLANE_V
]
=
data
+
(
x
>>
img
->
x_chroma_shift
)
+
(
y
>>
img
->
y_chroma_shift
)
*
img
->
stride
[
VPX_PLANE_V
];
img
->
planes
[
VPX_PLANE_V
]
=
data
+
(
x
>>
img
->
x_chroma_shift
)
*
bytes_per_sample
+
(
y
>>
img
->
y_chroma_shift
)
*
img
->
stride
[
VPX_PLANE_V
];
}
else
{
img
->
planes
[
VPX_PLANE_V
]
=
data
+
(
x
>>
img
->
x_chroma_shift
)
+
(
y
>>
img
->
y_chroma_shift
)
*
img
->
stride
[
VPX_PLANE_V
];
img
->
planes
[
VPX_PLANE_V
]
=
data
+
(
x
>>
img
->
x_chroma_shift
)
*
bytes_per_sample
+
(
y
>>
img
->
y_chroma_shift
)
*
img
->
stride
[
VPX_PLANE_V
];
data
+=
(
img
->
h
>>
img
->
y_chroma_shift
)
*
img
->
stride
[
VPX_PLANE_V
];
img
->
planes
[
VPX_PLANE_U
]
=
data
+
(
x
>>
img
->
x_chroma_shift
)
+
(
y
>>
img
->
y_chroma_shift
)
*
img
->
stride
[
VPX_PLANE_U
];
img
->
planes
[
VPX_PLANE_U
]
=
data
+
(
x
>>
img
->
x_chroma_shift
)
*
bytes_per_sample
+
(
y
>>
img
->
y_chroma_shift
)
*
img
->
stride
[
VPX_PLANE_U
];
}
}
return
0
;
}
return
-
1
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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