/* Return the buffer at the given absolute index and increment the index */ staticstruct lookahead_entry *pop(struct lookahead_ctx *ctx, int *idx) {
int index = *idx; struct lookahead_entry *buf = ctx->buf + index;
assert(index < ctx->max_sz);
if (++index >= ctx->max_sz) index -= ctx->max_sz;
*idx = index; return buf;
}
void av1_lookahead_destroy(struct lookahead_ctx *ctx) {
if (ctx) {
if (ctx->buf) {
int i;
for (i = 0; i < ctx->max_sz; i++) aom_free_frame_buffer(&ctx->buf[i].img);
free(ctx->buf);
}
free(ctx);
}
}
struct lookahead_ctx *av1_lookahead_init(
int width, int height, int subsampling_x, int subsampling_y,
int use_highbitdepth, int depth, int border_in_pixels, int byte_alignment,
int num_lap_buffers, bool is_all_intra, bool alloc_pyramid) {
int lag_in_frames = AOMMAX(1, depth);
// For all-intra frame encoding, previous source frames are not required. // Hence max_pre_frames is set to 0 in this case. As previous source frames // are accessed using a negative index to av1_lookahead_peek(), setting // max_pre_frames to 0 will cause av1_lookahead_peek() to return NULL for a // negative index. const uint8_t max_pre_frames = is_all_intra ? 0 : MAX_PRE_FRAMES;
// Add the lags to depth and clamp
depth += num_lap_buffers;
depth = clamp(depth, 1, MAX_TOTAL_BUFFERS);
int av1_lookahead_full(conststruct lookahead_ctx *ctx) { // TODO(angiebird): Test this function. return ctx->read_ctxs[ENCODE_STAGE].sz >= ctx->read_ctxs[ENCODE_STAGE].pop_sz;
}
int av1_lookahead_push(struct lookahead_ctx *ctx, const YV12_BUFFER_CONFIG *src,
int64_t ts_start, int64_t ts_end, int use_highbitdepth, bool alloc_pyramid, aom_enc_frame_flags_t flags) {
int width = src->y_crop_width;
int height = src->y_crop_height;
int uv_width = src->uv_crop_width;
int uv_height = src->uv_crop_height;
int subsampling_x = src->subsampling_x;
int subsampling_y = src->subsampling_y;
int larger_dimensions, new_dimensions;
assert(ctx->read_ctxs[ENCODE_STAGE].valid == 1);
if (ctx->read_ctxs[ENCODE_STAGE].sz + ctx->max_pre_frames > ctx->max_sz) return1;
ctx->read_ctxs[ENCODE_STAGE].sz++;
if (ctx->read_ctxs[LAP_STAGE].valid) {
ctx->read_ctxs[LAP_STAGE].sz++;
}
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.15Bemerkung:
(vorverarbeitet am 2026-08-26)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.