mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-29 19:50:40 +00:00
[MOVED FROM BAD 044/134] vp8: Use VPX_PLANE_* instead of PLANE_*
This commit is contained in:
parent
b9e31e22c6
commit
2014a7eee2
3 changed files with 24 additions and 9 deletions
|
@ -390,7 +390,8 @@ gst_vp8_dec_image_to_buffer (GstVP8Dec * dec, const vpx_image_t * img,
|
|||
w = MIN (w, img->w);
|
||||
|
||||
for (i = 0; i < h; i++)
|
||||
memcpy (d + i * stride, img->planes[PLANE_Y] + i * img->stride[PLANE_Y], w);
|
||||
memcpy (d + i * stride,
|
||||
img->planes[VPX_PLANE_Y] + i * img->stride[VPX_PLANE_Y], w);
|
||||
|
||||
d = GST_BUFFER_DATA (buffer) +
|
||||
gst_video_format_get_component_offset (decoder->state.format, 1,
|
||||
|
@ -405,14 +406,16 @@ gst_vp8_dec_image_to_buffer (GstVP8Dec * dec, const vpx_image_t * img,
|
|||
decoder->state.width);
|
||||
w = MIN (w, img->w >> img->x_chroma_shift);
|
||||
for (i = 0; i < h; i++)
|
||||
memcpy (d + i * stride, img->planes[PLANE_U] + i * img->stride[PLANE_U], w);
|
||||
memcpy (d + i * stride,
|
||||
img->planes[VPX_PLANE_U] + i * img->stride[VPX_PLANE_U], w);
|
||||
|
||||
d = GST_BUFFER_DATA (buffer) +
|
||||
gst_video_format_get_component_offset (decoder->state.format, 2,
|
||||
decoder->state.width, decoder->state.height);
|
||||
/* Same stride, height, width as above */
|
||||
for (i = 0; i < h; i++)
|
||||
memcpy (d + i * stride, img->planes[PLANE_V] + i * img->stride[PLANE_V], w);
|
||||
memcpy (d + i * stride,
|
||||
img->planes[VPX_PLANE_V] + i * img->stride[VPX_PLANE_V], w);
|
||||
}
|
||||
|
||||
static GstFlowReturn
|
||||
|
|
|
@ -613,22 +613,22 @@ gst_vp8_enc_buffer_to_image (GstVP8Enc * enc, GstBuffer * buffer)
|
|||
image->w = image->d_w = encoder->state.width;
|
||||
image->h = image->d_h = encoder->state.height;
|
||||
|
||||
image->stride[PLANE_Y] =
|
||||
image->stride[VPX_PLANE_Y] =
|
||||
gst_video_format_get_row_stride (encoder->state.format, 0,
|
||||
encoder->state.width);
|
||||
image->stride[PLANE_U] =
|
||||
image->stride[VPX_PLANE_U] =
|
||||
gst_video_format_get_row_stride (encoder->state.format, 1,
|
||||
encoder->state.width);
|
||||
image->stride[PLANE_V] =
|
||||
image->stride[VPX_PLANE_V] =
|
||||
gst_video_format_get_row_stride (encoder->state.format, 2,
|
||||
encoder->state.width);
|
||||
image->planes[PLANE_Y] =
|
||||
image->planes[VPX_PLANE_Y] =
|
||||
data + gst_video_format_get_component_offset (encoder->state.format, 0,
|
||||
encoder->state.width, encoder->state.height);
|
||||
image->planes[PLANE_U] =
|
||||
image->planes[VPX_PLANE_U] =
|
||||
data + gst_video_format_get_component_offset (encoder->state.format, 1,
|
||||
encoder->state.width, encoder->state.height);
|
||||
image->planes[PLANE_V] =
|
||||
image->planes[VPX_PLANE_V] =
|
||||
data + gst_video_format_get_component_offset (encoder->state.format, 2,
|
||||
encoder->state.width, encoder->state.height);
|
||||
|
||||
|
|
|
@ -30,6 +30,18 @@ G_BEGIN_DECLS
|
|||
#define VPX_IMG_FMT_I420 IMG_FMT_I420
|
||||
#endif
|
||||
|
||||
#ifndef VPX_PLANE_Y
|
||||
#define VPX_PLANE_Y PLANE_Y
|
||||
#endif
|
||||
|
||||
#ifndef VPX_PLANE_U
|
||||
#define VPX_PLANE_U PLANE_U
|
||||
#endif
|
||||
|
||||
#ifndef VPX_PLANE_V
|
||||
#define VPX_PLANE_V PLANE_V
|
||||
#endif
|
||||
|
||||
const char * gst_vpx_error_name (vpx_codec_err_t status);
|
||||
|
||||
G_END_DECLS
|
||||
|
|
Loading…
Reference in a new issue