Skip to content

Commit fd1574d

Browse files
committed
avcodec/magicyuvenc: remove unnecessary indirection
1 parent 8c3169f commit fd1574d

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

libavcodec/magicyuvenc.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ static int encode_table(AVCodecContext *avctx,
415415
return 0;
416416
}
417417

418-
static int encode_plane_slice(const uint8_t *src, uint8_t *dst, int dst_size,
418+
static int encode_plane_slice(const uint8_t *src, uint8_t *dst, unsigned dst_size,
419419
int width, int height, HuffEntry *he, int prediction)
420420
{
421421
PutBitContext pb;
@@ -453,17 +453,14 @@ static int encode_slice(AVCodecContext *avctx, void *tdata,
453453
const int slice_height = s->slice_height;
454454
const int last_height = FFMIN(slice_height, avctx->height - n * slice_height);
455455
const int height = (n < (s->nb_slices - 1)) ? slice_height : last_height;
456-
PutByteContext pb;
457456

458457
for (int i = 0; i < s->planes; i++) {
459458
Slice *sl = &s->slices[n * s->planes + i];
460459

461-
bytestream2_init_writer(&pb, sl->bitslice, s->bitslice_size);
462-
463460
sl->size =
464461
encode_plane_slice(sl->slice,
465462
sl->bitslice,
466-
bytestream2_get_bytes_left_p(&pb),
463+
s->bitslice_size,
467464
AV_CEIL_RSHIFT(avctx->width, s->hshift[i]),
468465
AV_CEIL_RSHIFT(height, s->vshift[i]),
469466
s->he[i], s->frame_pred);

0 commit comments

Comments
 (0)