Commit 4c7a783e authored by Dmitry Kovalev's avatar Dmitry Kovalev Committed by Gerrit Code Review
Browse files

Merge "Adding get_frame_pkt_flags() function."

parents 4d10506d bc9204a9
......@@ -793,6 +793,23 @@ static int64_t ticks_to_timebase_units(const vpx_rational_t *timebase,
return (n * timebase->den + round) / timebase->num / TICKS_PER_SEC;
}
static vpx_codec_frame_flags_t get_frame_pkt_flags(const VP9_COMP *cpi,
unsigned int lib_flags) {
vpx_codec_frame_flags_t flags = lib_flags << 16;
if (lib_flags & FRAMEFLAGS_KEY
#if CONFIG_SPATIAL_SVC
|| (is_spatial_svc(cpi) && cpi->svc.layer_context[0].is_key_frame)
#endif
)
flags |= VPX_FRAME_IS_KEY;
if (cpi->droppable)
flags |= VPX_FRAME_IS_DROPPABLE;
return flags;
}
static vpx_codec_err_t encoder_encode(vpx_codec_alg_priv_t *ctx,
const vpx_image_t *img,
vpx_codec_pts_t pts,
......@@ -923,18 +940,7 @@ static vpx_codec_err_t encoder_encode(vpx_codec_alg_priv_t *ctx,
pkt.data.frame.duration =
(unsigned long)ticks_to_timebase_units(timebase,
dst_end_time_stamp - dst_time_stamp);
pkt.data.frame.flags = lib_flags << 16;
if (lib_flags & FRAMEFLAGS_KEY
#if CONFIG_SPATIAL_SVC
|| (is_spatial_svc(cpi) &&
cpi->svc.layer_context[0].is_key_frame)
#endif
)
pkt.data.frame.flags |= VPX_FRAME_IS_KEY;
if (cpi->droppable)
pkt.data.frame.flags |= VPX_FRAME_IS_DROPPABLE;
pkt.data.frame.flags = get_frame_pkt_flags(cpi, lib_flags);
if (ctx->pending_cx_data) {
ctx->pending_frame_sizes[ctx->pending_frame_count++] = size;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment