]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/vp8.h
Merge commit '3794062ab1a13442b06f6d76c54dce51ffa54697'
[ffmpeg] / libavcodec / vp8.h
index 3910b5c0dd53ca7d2d251509c78607d2421b01c0..8263997e3fcd48f2f07c61644bedb558a8712223 100644 (file)
@@ -26,6 +26,8 @@
 #ifndef AVCODEC_VP8_H
 #define AVCODEC_VP8_H
 
+#include <stdatomic.h>
+
 #include "libavutil/buffer.h"
 #include "libavutil/thread.h"
 
@@ -91,6 +93,16 @@ typedef struct VP8Macroblock {
     VP56mv bmv[16];
 } VP8Macroblock;
 
+typedef struct VP8intmv {
+    int x;
+    int y;
+} VP8intmv;
+
+typedef struct VP8mvbounds {
+    VP8intmv mv_min;
+    VP8intmv mv_max;
+} VP8mvbounds;
+
 typedef struct VP8ThreadData {
     DECLARE_ALIGNED(16, int16_t, block)[6][4][16];
     DECLARE_ALIGNED(16, int16_t, block_dc)[16];
@@ -114,12 +126,13 @@ typedef struct VP8ThreadData {
     pthread_mutex_t lock;
     pthread_cond_t cond;
 #endif
-    int thread_mb_pos; // (mb_y << 16) | (mb_x & 0xFFFF)
-    int wait_mb_pos; // What the current thread is waiting on.
+    atomic_int thread_mb_pos; // (mb_y << 16) | (mb_x & 0xFFFF)
+    atomic_int wait_mb_pos; // What the current thread is waiting on.
 
 #define EDGE_EMU_LINESIZE 32
     DECLARE_ALIGNED(16, uint8_t, edge_emu_buffer)[21 * EDGE_EMU_LINESIZE];
     VP8FilterStrength *filter_strength;
+    VP8mvbounds mv_bounds;
 } VP8ThreadData;
 
 typedef struct VP8Frame {
@@ -127,11 +140,6 @@ typedef struct VP8Frame {
     AVBufferRef *seg_map;
 } VP8Frame;
 
-typedef struct VP8intmv {
-    int x;
-    int y;
-} VP8intmv;
-
 #define MAX_THREADS 8
 typedef struct VP8Context {
     VP8ThreadData *thread_data;
@@ -150,8 +158,7 @@ typedef struct VP8Context {
     uint8_t deblock_filter;
     uint8_t mbskip_enabled;
     uint8_t profile;
-    VP8intmv mv_min;
-    VP8intmv mv_max;
+    VP8mvbounds mv_bounds;
 
     int8_t sign_bias[4]; ///< one state [0, 1] per ref frame type
     int ref_count[3];