]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/ffv1.c
vaapi_encode: Support VBR mode
[ffmpeg] / libavcodec / ffv1.c
index 0836d42012eaa1646b8e7157d54453688bb18d4a..89d27bbca1bc5dd491a27716996e86ce3c3d1fae 100644 (file)
  */
 
 #include "libavutil/attributes.h"
-#include "libavutil/avassert.h"
+
 #include "avcodec.h"
-#include "get_bits.h"
 #include "put_bits.h"
 #include "rangecoder.h"
-#include "golomb.h"
 #include "mathops.h"
 #include "ffv1.h"
 
@@ -160,7 +158,7 @@ int ffv1_init_slice_state(FFV1Context *f, FFV1Context *fs)
     for (j = 0; j < f->plane_count; j++) {
         PlaneContext *const p = &fs->plane[j];
 
-        if (fs->ac) {
+        if (fs->ac != AC_GOLOMB_RICE) {
             if (!p->state)
                 p->state = av_malloc(CONTEXT_SIZE * p->context_count *
                                      sizeof(uint8_t));
@@ -174,7 +172,7 @@ int ffv1_init_slice_state(FFV1Context *f, FFV1Context *fs)
         }
     }
 
-    if (fs->ac > 1) {
+    if (fs->ac == AC_RANGE_CUSTOM_TAB) {
         //FIXME only redo if state_transition changed
         for (j = 1; j < 256; j++) {
             fs->c.one_state[j]        = f->state_transition[j];
@@ -257,7 +255,7 @@ void ffv1_clear_slice_state(FFV1Context *f, FFV1Context *fs)
         p->interlace_bit_state[0] = 128;
         p->interlace_bit_state[1] = 128;
 
-        if (fs->ac) {
+        if (fs->ac != AC_GOLOMB_RICE) {
             if (f->initial_states[p->quant_table_index]) {
                 memcpy(p->state, f->initial_states[p->quant_table_index],
                        CONTEXT_SIZE * p->context_count);