summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_ethread.h
diff options
context:
space:
mode:
Diffstat (limited to 'vp9/encoder/vp9_ethread.h')
-rw-r--r--vp9/encoder/vp9_ethread.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/vp9/encoder/vp9_ethread.h b/vp9/encoder/vp9_ethread.h
index 1efa4dcde..968e500fb 100644
--- a/vp9/encoder/vp9_ethread.h
+++ b/vp9/encoder/vp9_ethread.h
@@ -15,6 +15,10 @@
extern "C" {
#endif
+#define MAX_NUM_TILE_COLS (1 << 6)
+#define MAX_NUM_TILE_ROWS 4
+#define MAX_NUM_THREADS 80
+
struct VP9_COMP;
struct ThreadData;
@@ -22,10 +26,41 @@ typedef struct EncWorkerData {
struct VP9_COMP *cpi;
struct ThreadData *td;
int start;
+ int thread_id;
+ int tile_completion_status[MAX_NUM_TILE_COLS];
} EncWorkerData;
+// Encoder row synchronization
+typedef struct VP9RowMTSyncData {
+#if CONFIG_MULTITHREAD
+ pthread_mutex_t *mutex_;
+ pthread_cond_t *cond_;
+#endif
+ // Allocate memory to store the sb/mb block index in each row.
+ int *cur_col;
+ int sync_range;
+ int rows;
+} VP9RowMTSync;
+
void vp9_encode_tiles_mt(struct VP9_COMP *cpi);
+void vp9_encode_fp_row_mt(struct VP9_COMP *cpi);
+
+void vp9_row_mt_sync_read(VP9RowMTSync *const row_mt_sync, int r, int c);
+void vp9_row_mt_sync_write(VP9RowMTSync *const row_mt_sync, int r, int c,
+ const int cols);
+
+void vp9_row_mt_sync_read_dummy(VP9RowMTSync *const row_mt_sync, int r, int c);
+void vp9_row_mt_sync_write_dummy(VP9RowMTSync *const row_mt_sync, int r, int c,
+ const int cols);
+
+// Allocate memory for row based multi-threading synchronization.
+void vp9_row_mt_sync_mem_alloc(VP9RowMTSync *row_mt_sync, struct VP9Common *cm,
+ int rows);
+
+// Deallocate row based multi-threading synchronization related mutex and data.
+void vp9_row_mt_sync_mem_dealloc(VP9RowMTSync *row_mt_sync);
+
#ifdef __cplusplus
} // extern "C"
#endif