[vlc-commits] packetizer: av1: complete and use canonical names for frame type

Francois Cartegnie git at videolan.org
Wed Oct 10 16:15:32 CEST 2018


vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Oct  5 22:46:23 2018 +0200| [5413be8a0508b0f3ea7ae5f32a122dbc3e29ea4b] | committer: Tristan Matthews

packetizer: av1: complete and use canonical names for frame type

(cherry picked from commit 0f782355c8be368d9e7f7a96f66c2964bbbfb1df)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=5413be8a0508b0f3ea7ae5f32a122dbc3e29ea4b
---

 modules/packetizer/av1.c     | 14 ++++++++++++--
 modules/packetizer/av1_obu.c |  2 +-
 modules/packetizer/av1_obu.h |  8 ++++----
 3 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/modules/packetizer/av1.c b/modules/packetizer/av1.c
index 742487f0c6..961382dcbf 100644
--- a/modules/packetizer/av1.c
+++ b/modules/packetizer/av1.c
@@ -314,8 +314,18 @@ static block_t *ParseOBUBlock(decoder_t *p_dec, block_t *p_obu)
                         if((p_sys->i_seen & AV1_OBU_TEMPORAL_DELIMITER) && p_sys->tu.b_has_visible_frame)
                             p_output = OutputQueues(p_dec, p_sys->p_sequence_header != NULL);
 
-                        if(AV1_get_frame_type(p_fh) == AV1_KEY_FRAME)
-                            p_obu->i_flags |= BLOCK_FLAG_TYPE_I;
+                        switch(AV1_get_frame_type(p_fh))
+                        {
+                            case AV1_FRAME_TYPE_KEY:
+                            case AV1_FRAME_TYPE_INTRA_ONLY:
+                                p_obu->i_flags |= BLOCK_FLAG_TYPE_I;
+                                break;
+                            case AV1_FRAME_TYPE_INTER:
+                                p_obu->i_flags |= BLOCK_FLAG_TYPE_P;
+                                break;
+                            default:
+                                break;
+                        }
 
                         p_sys->tu.b_has_visible_frame |= AV1_get_frame_visibility(p_fh);
                         AV1_release_frame_header(p_fh);
diff --git a/modules/packetizer/av1_obu.c b/modules/packetizer/av1_obu.c
index 38218459a6..7bb9a257b0 100644
--- a/modules/packetizer/av1_obu.c
+++ b/modules/packetizer/av1_obu.c
@@ -421,7 +421,7 @@ static bool av1_parse_uncompressed_header(bs_t *p_bs, struct av1_uncompressed_he
 {
     if(p_seq->reduced_still_picture_header)
     {
-        p_uh->frame_type = AV1_KEY_FRAME;
+        p_uh->frame_type = AV1_FRAME_TYPE_KEY;
         p_uh->show_frame = 1;
     }
     else
diff --git a/modules/packetizer/av1_obu.h b/modules/packetizer/av1_obu.h
index 36b2510965..249fa54183 100644
--- a/modules/packetizer/av1_obu.h
+++ b/modules/packetizer/av1_obu.h
@@ -174,10 +174,10 @@ bool AV1_get_frame_rate(const av1_OBU_sequence_header_t *, unsigned *, unsigned
 typedef struct av1_OBU_frame_header_t av1_OBU_frame_header_t;
 enum av1_frame_type_e
 {
-    AV1_KEY_FRAME        = 0,
-    AV1_INTER_FRAME      = 1,
-    AV1_INTRA_ONLY_FRAME = 2,
-    AV1_SWITCH_FRAME     = 3,
+    AV1_FRAME_TYPE_KEY        = 0,
+    AV1_FRAME_TYPE_INTER      = 1,
+    AV1_FRAME_TYPE_INTRA_ONLY = 2,
+    AV1_FRAME_TYPE_SWITCH     = 3,
 };
 
 av1_OBU_frame_header_t * AV1_OBU_parse_frame_header(const uint8_t *p_data, size_t i_data,



More information about the vlc-commits mailing list