static int compare_by_prob(const void *a, const void *b)
{
- PTable a_val = *(PTable *)a;
- PTable b_val = *(PTable *)b;
- return a_val.prob - b_val.prob;
+ const PTable *a2 = a;
+ const PTable *b2 = b;
+ return a2->prob - b2->prob;
}
static void magy_huffman_compute_bits(PTable *prob_table, HuffEntry *distincts,
if (count)
put_bits(&pb, 32 - count, 0);
- count = put_bits_count(&pb);
-
flush_put_bits(&pb);
- return count >> 3;
+ return put_bytes_output(&pb);
}
static int magy_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
AV_CEIL_RSHIFT(frame->height, s->vshift[i]),
&s->pb, s->he[i]);
}
- s->tables_size = (put_bits_count(&s->pb) + 7) >> 3;
+ s->tables_size = put_bytes_count(&s->pb, 1);
bytestream2_skip_p(&pb, s->tables_size);
for (i = 0; i < s->planes; i++) {
.version = LIBAVUTIL_VERSION_INT,
};
-AVCodec ff_magicyuv_encoder = {
+const AVCodec ff_magicyuv_encoder = {
.name = "magicyuv",
.long_name = NULL_IF_CONFIG_SMALL("MagicYUV video"),
.type = AVMEDIA_TYPE_VIDEO,