diff mbox series

[FFmpeg-devel] libavcodec/vp9: export block type in VP9

Message ID 20200715231108.814133-1-yonglel@google.com
State New
Headers show
Series [FFmpeg-devel] libavcodec/vp9: export block type in VP9 | expand

Checks

Context Check Description
andriy/default pending
andriy/make fail Make failed

Commit Message

Yongle Lin July 15, 2020, 11:11 p.m. UTC
---
 libavcodec/vp9.c      | 10 ++++++++++
 libavcodec/vp9block.c |  6 ++++++
 libavcodec/vp9dec.h   |  4 ++++
 3 files changed, 20 insertions(+)
diff mbox series

Patch

diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index fd0bab14a2..6bd6bd4fa9 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -1541,6 +1541,16 @@  static int vp9_export_enc_params(VP9Context *s, VP9Frame *frame)
                     if (s->s.h.segmentation.absolute_vals)
                         b->delta_qp -= par->qp;
                 }
+
+                if (td->block_structure[block_tile].skip)
+                    b->flags |= AV_VIDEO_ENC_BLOCK_SKIP;
+                if (td->block_structure[block_tile].intra) {
+                    b->flags |= AV_VIDEO_ENC_BLOCK_INTRA;
+                } else {
+                    b->ref[0] = td->block_structure[block_tile].ref[0];
+                    if (td->block_structure[block_tile].comp)
+                        b->ref[1] = td->block_structure[block_tile].ref[1];
+                }
             }
         }
     }
diff --git a/libavcodec/vp9block.c b/libavcodec/vp9block.c
index ec16e26c69..3b500c8259 100644
--- a/libavcodec/vp9block.c
+++ b/libavcodec/vp9block.c
@@ -1295,6 +1295,12 @@  void ff_vp9_decode_block(VP9TileData *td, int row, int col,
             td->block_structure[td->nb_block_structure].col = col;
             td->block_structure[td->nb_block_structure].block_size_idx_x = av_log2(w4);
             td->block_structure[td->nb_block_structure].block_size_idx_y = av_log2(h4);
+
+            td->block_structure[td->nb_block_structure].intra = b->intra;
+            td->block_structure[td->nb_block_structure].skip = b->skip;
+            td->block_structure[td->nb_block_structure].comp = b->comp;
+            td->block_structure[td->nb_block_structure].ref[0] = b->ref[0];
+            td->block_structure[td->nb_block_structure].ref[1] = b->ref[1];
             td->nb_block_structure++;
         }
 
diff --git a/libavcodec/vp9dec.h b/libavcodec/vp9dec.h
index cc2440b854..6ecb544274 100644
--- a/libavcodec/vp9dec.h
+++ b/libavcodec/vp9dec.h
@@ -231,6 +231,10 @@  struct VP9TileData {
         unsigned int col:13;
         unsigned int block_size_idx_x:2;
         unsigned int block_size_idx_y:2;
+        unsigned int intra:1;
+        unsigned int skip:1;
+        unsigned int comp:1;
+        uint8_t ref[2];
     } *block_structure;
     unsigned int nb_block_structure;
 };