mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-06-04 05:57:49 +02:00
avcodec/bink: Provide non NULL context to av_log()
Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
9446c5887f
commit
b89fc3d01b
@ -609,7 +609,7 @@ static inline int binkb_get_value(BinkContext *c, int bundle_num)
|
|||||||
* @param quant_matrices quantization matrices
|
* @param quant_matrices quantization matrices
|
||||||
* @return 0 for success, negative value in other cases
|
* @return 0 for success, negative value in other cases
|
||||||
*/
|
*/
|
||||||
static int read_dct_coeffs(GetBitContext *gb, int32_t block[64],
|
static int read_dct_coeffs(BinkContext *c, GetBitContext *gb, int32_t block[64],
|
||||||
const uint8_t *scan, int *coef_count_,
|
const uint8_t *scan, int *coef_count_,
|
||||||
int coef_idx[64], int q)
|
int coef_idx[64], int q)
|
||||||
{
|
{
|
||||||
@ -692,7 +692,7 @@ static int read_dct_coeffs(GetBitContext *gb, int32_t block[64],
|
|||||||
} else {
|
} else {
|
||||||
quant_idx = q;
|
quant_idx = q;
|
||||||
if (quant_idx > 15U) {
|
if (quant_idx > 15U) {
|
||||||
av_log(NULL, AV_LOG_ERROR, "quant_index %d out of range\n", quant_idx);
|
av_log(c->avctx, AV_LOG_ERROR, "quant_index %d out of range\n", quant_idx);
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -885,7 +885,7 @@ static int binkb_decode_plane(BinkContext *c, AVFrame *frame, GetBitContext *gb,
|
|||||||
memset(dctblock, 0, sizeof(*dctblock) * 64);
|
memset(dctblock, 0, sizeof(*dctblock) * 64);
|
||||||
dctblock[0] = binkb_get_value(c, BINKB_SRC_INTRA_DC);
|
dctblock[0] = binkb_get_value(c, BINKB_SRC_INTRA_DC);
|
||||||
qp = binkb_get_value(c, BINKB_SRC_INTRA_Q);
|
qp = binkb_get_value(c, BINKB_SRC_INTRA_Q);
|
||||||
if ((quant_idx = read_dct_coeffs(gb, dctblock, bink_scan, &coef_count, coef_idx, qp)) < 0)
|
if ((quant_idx = read_dct_coeffs(c, gb, dctblock, bink_scan, &coef_count, coef_idx, qp)) < 0)
|
||||||
return quant_idx;
|
return quant_idx;
|
||||||
unquantize_dct_coeffs(dctblock, binkb_intra_quant[quant_idx], coef_count, coef_idx, bink_scan);
|
unquantize_dct_coeffs(dctblock, binkb_intra_quant[quant_idx], coef_count, coef_idx, bink_scan);
|
||||||
c->binkdsp.idct_put(dst, stride, dctblock);
|
c->binkdsp.idct_put(dst, stride, dctblock);
|
||||||
@ -920,7 +920,7 @@ static int binkb_decode_plane(BinkContext *c, AVFrame *frame, GetBitContext *gb,
|
|||||||
memset(dctblock, 0, sizeof(*dctblock) * 64);
|
memset(dctblock, 0, sizeof(*dctblock) * 64);
|
||||||
dctblock[0] = binkb_get_value(c, BINKB_SRC_INTER_DC);
|
dctblock[0] = binkb_get_value(c, BINKB_SRC_INTER_DC);
|
||||||
qp = binkb_get_value(c, BINKB_SRC_INTER_Q);
|
qp = binkb_get_value(c, BINKB_SRC_INTER_Q);
|
||||||
if ((quant_idx = read_dct_coeffs(gb, dctblock, bink_scan, &coef_count, coef_idx, qp)) < 0)
|
if ((quant_idx = read_dct_coeffs(c, gb, dctblock, bink_scan, &coef_count, coef_idx, qp)) < 0)
|
||||||
return quant_idx;
|
return quant_idx;
|
||||||
unquantize_dct_coeffs(dctblock, binkb_inter_quant[quant_idx], coef_count, coef_idx, bink_scan);
|
unquantize_dct_coeffs(dctblock, binkb_inter_quant[quant_idx], coef_count, coef_idx, bink_scan);
|
||||||
c->binkdsp.idct_add(dst, stride, dctblock);
|
c->binkdsp.idct_add(dst, stride, dctblock);
|
||||||
@ -1093,7 +1093,7 @@ static int bink_decode_plane(BinkContext *c, AVFrame *frame, GetBitContext *gb,
|
|||||||
case INTRA_BLOCK:
|
case INTRA_BLOCK:
|
||||||
memset(dctblock, 0, sizeof(*dctblock) * 64);
|
memset(dctblock, 0, sizeof(*dctblock) * 64);
|
||||||
dctblock[0] = get_value(c, BINK_SRC_INTRA_DC);
|
dctblock[0] = get_value(c, BINK_SRC_INTRA_DC);
|
||||||
if ((quant_idx = read_dct_coeffs(gb, dctblock, bink_scan, &coef_count, coef_idx, -1)) < 0)
|
if ((quant_idx = read_dct_coeffs(c, gb, dctblock, bink_scan, &coef_count, coef_idx, -1)) < 0)
|
||||||
return quant_idx;
|
return quant_idx;
|
||||||
unquantize_dct_coeffs(dctblock, bink_intra_quant[quant_idx], coef_count, coef_idx, bink_scan);
|
unquantize_dct_coeffs(dctblock, bink_intra_quant[quant_idx], coef_count, coef_idx, bink_scan);
|
||||||
c->binkdsp.idct_put(ublock, 8, dctblock);
|
c->binkdsp.idct_put(ublock, 8, dctblock);
|
||||||
@ -1168,7 +1168,7 @@ static int bink_decode_plane(BinkContext *c, AVFrame *frame, GetBitContext *gb,
|
|||||||
case INTRA_BLOCK:
|
case INTRA_BLOCK:
|
||||||
memset(dctblock, 0, sizeof(*dctblock) * 64);
|
memset(dctblock, 0, sizeof(*dctblock) * 64);
|
||||||
dctblock[0] = get_value(c, BINK_SRC_INTRA_DC);
|
dctblock[0] = get_value(c, BINK_SRC_INTRA_DC);
|
||||||
if ((quant_idx = read_dct_coeffs(gb, dctblock, bink_scan, &coef_count, coef_idx, -1)) < 0)
|
if ((quant_idx = read_dct_coeffs(c, gb, dctblock, bink_scan, &coef_count, coef_idx, -1)) < 0)
|
||||||
return quant_idx;
|
return quant_idx;
|
||||||
unquantize_dct_coeffs(dctblock, bink_intra_quant[quant_idx], coef_count, coef_idx, bink_scan);
|
unquantize_dct_coeffs(dctblock, bink_intra_quant[quant_idx], coef_count, coef_idx, bink_scan);
|
||||||
c->binkdsp.idct_put(dst, stride, dctblock);
|
c->binkdsp.idct_put(dst, stride, dctblock);
|
||||||
@ -1184,7 +1184,7 @@ static int bink_decode_plane(BinkContext *c, AVFrame *frame, GetBitContext *gb,
|
|||||||
return ret;
|
return ret;
|
||||||
memset(dctblock, 0, sizeof(*dctblock) * 64);
|
memset(dctblock, 0, sizeof(*dctblock) * 64);
|
||||||
dctblock[0] = get_value(c, BINK_SRC_INTER_DC);
|
dctblock[0] = get_value(c, BINK_SRC_INTER_DC);
|
||||||
if ((quant_idx = read_dct_coeffs(gb, dctblock, bink_scan, &coef_count, coef_idx, -1)) < 0)
|
if ((quant_idx = read_dct_coeffs(c, gb, dctblock, bink_scan, &coef_count, coef_idx, -1)) < 0)
|
||||||
return quant_idx;
|
return quant_idx;
|
||||||
unquantize_dct_coeffs(dctblock, bink_inter_quant[quant_idx], coef_count, coef_idx, bink_scan);
|
unquantize_dct_coeffs(dctblock, bink_inter_quant[quant_idx], coef_count, coef_idx, bink_scan);
|
||||||
c->binkdsp.idct_add(dst, stride, dctblock);
|
c->binkdsp.idct_add(dst, stride, dctblock);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user