]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/proresenc_kostya.c
Merge remote-tracking branch 'qatar/master'
[ffmpeg] / libavcodec / proresenc_kostya.c
index d46401b7546f0e750c062d89eac0d479b6d6389d..eb962b7a98595cbd0b4c689c67ef008257c8db4e 100644 (file)
@@ -3,6 +3,9 @@
  *
  * Copyright (c) 2012 Konstantin Shishkov
  *
+ * This encoder appears to be based on Anatoliy Wassermans considering
+ * similarities in the bugs.
+ *
  * This file is part of Libav.
  *
  * Libav is free software; you can redistribute it and/or
@@ -289,8 +292,7 @@ static inline void encode_vlc_codeword(PutBitContext *pb, unsigned codebook, int
         exponent = av_log2(val);
 
         put_bits(pb, exponent - exp_order + switch_bits, 0);
-        put_bits(pb, 1, 1);
-        put_bits(pb, exponent, val);
+        put_bits(pb, exponent + 1, val);
     } else {
         exponent = val >> rice_order;
 
@@ -700,10 +702,8 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 
     pkt_size = ctx->frame_size + FF_MIN_BUFFER_SIZE;
 
-    if ((ret = ff_alloc_packet(pkt, pkt_size)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet.\n");
+    if ((ret = ff_alloc_packet2(avctx, pkt, pkt_size)) < 0)
         return ret;
-    }
 
     orig_buf = pkt->data;