From b8acdc784a20fb7db94b85dd06b0b930cf8296fe Mon Sep 17 00:00:00 2001 From: Laurent Fasnacht Date: Tue, 3 Jun 2014 15:02:14 +0200 Subject: [PATCH] Fix compilation of encoder.c with -D_DEBUG --- src/encoder.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/encoder.c b/src/encoder.c index 96451f0e..dc55b0a8 100644 --- a/src/encoder.c +++ b/src/encoder.c @@ -44,6 +44,26 @@ #include "rdo.h" /* Local functions. */ +static int lcu_at_slice_start(const encoder_control * const encoder, int lcu_addr_in_ts) { + int i; + assert(lcu_addr_in_ts >= 0 && lcu_addr_in_ts < encoder->in.height_in_lcu * encoder->in.width_in_lcu); + if (lcu_addr_in_ts == 0) return 1; + for (i = 0; i < encoder->slice_count; ++i) { + if (encoder->slice_addresses_in_ts[i] == lcu_addr_in_ts) return 1; + } + return 0; +} + +static int lcu_at_slice_end(const encoder_control * const encoder, int lcu_addr_in_ts) { + int i; + assert(lcu_addr_in_ts >= 0 && lcu_addr_in_ts < encoder->in.height_in_lcu * encoder->in.width_in_lcu); + if (lcu_addr_in_ts == encoder->in.height_in_lcu * encoder->in.width_in_lcu - 1) return 1; + for (i = 0; i < encoder->slice_count; ++i) { + if (encoder->slice_addresses_in_ts[i] == lcu_addr_in_ts + 1) return 1; + } + return 0; +} + int encoder_control_init(encoder_control * const encoder, const config * const cfg) { if (!cfg) {