[vlc-commits] mux: mp4: move in mpeg_parser_helpers remains
Francois Cartegnie
git at videolan.org
Mon Jan 18 15:15:18 CET 2016
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Jan 18 13:53:19 2016 +0100| [1eacc8c9b3babcb373c542e43cdc909d5b0a1e16] | committer: Francois Cartegnie
mux: mp4: move in mpeg_parser_helpers remains
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1eacc8c9b3babcb373c542e43cdc909d5b0a1e16
---
modules/demux/mpeg/mpeg_parser_helpers.h | 54 ------------------------------
modules/mux/Makefile.am | 1 -
modules/mux/mp4/libmp4mux.c | 28 +++++++++++++++-
3 files changed, 27 insertions(+), 56 deletions(-)
diff --git a/modules/demux/mpeg/mpeg_parser_helpers.h b/modules/demux/mpeg/mpeg_parser_helpers.h
deleted file mode 100644
index e9a59aa..0000000
--- a/modules/demux/mpeg/mpeg_parser_helpers.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*****************************************************************************
- * packetizer_helper.h: Packetizer helpers
- *****************************************************************************
- * Copyright (C) 2014 VLC authors and VideoLAN
- * $Id$
- *
- * Authors: Denis Charmet <typx at videolan.org>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-#ifndef MPEG_PARSER_HELPERS_H
-#define MPEG_PARSER_HELPERS_H
-#include <stdint.h>
-#include <vlc_bits.h>
-
-static inline void hevc_skip_profile_tiers_level( bs_t * bs, int32_t max_sub_layer_minus1 )
-{
- uint8_t sub_layer_profile_present_flag[8];
- uint8_t sub_layer_level_present_flag[8];
-
- /* skipping useless fields of the VPS see https://www.itu.int/rec/dologin_pub.asp?lang=e&id=T-REC-H.265-201304-I!!PDF-E&type=item */
- bs_skip( bs, 2 + 1 + 5 + 32 + 1 + 1 + 1 + 1 + 44 + 8 );
-
- for( int32_t i = 0; i < max_sub_layer_minus1; i++ )
- {
- sub_layer_profile_present_flag[i] = bs_read1( bs );
- sub_layer_level_present_flag[i] = bs_read1( bs );
- }
-
- if(max_sub_layer_minus1 > 0)
- bs_skip( bs, (8 - max_sub_layer_minus1) * 2 );
-
- for( int32_t i = 0; i < max_sub_layer_minus1; i++ )
- {
- if( sub_layer_profile_present_flag[i] )
- bs_skip( bs, 2 + 1 + 5 + 32 + 1 + 1 + 1 + 1 + 44 );
- if( sub_layer_level_present_flag[i] )
- bs_skip( bs, 8 );
- }
-}
-
-#endif /*MPEG_PARSER_HELPERS_H*/
diff --git a/modules/mux/Makefile.am b/modules/mux/Makefile.am
index c7798e0..7cdfde9 100644
--- a/modules/mux/Makefile.am
+++ b/modules/mux/Makefile.am
@@ -7,7 +7,6 @@ libmux_avi_plugin_la_SOURCES = mux/avi.c
libmux_mp4_plugin_la_SOURCES = mux/mp4/mp4.c \
mux/mp4/libmp4mux.c mux/mp4/libmp4mux.h \
packetizer/hxxx_nal.h demux/mp4/libmp4.h \
- demux/mpeg/mpeg_parser_helpers.h \
packetizer/h264_nal.c packetizer/h264_nal.h
libmux_mpjpeg_plugin_la_SOURCES = mux/mpjpeg.c
libmux_ps_plugin_la_SOURCES = \
diff --git a/modules/mux/mp4/libmp4mux.c b/modules/mux/mp4/libmp4mux.c
index 51f5c7f..b16b8f2 100644
--- a/modules/mux/mp4/libmp4mux.c
+++ b/modules/mux/mp4/libmp4mux.c
@@ -22,7 +22,6 @@
*****************************************************************************/
#include "libmp4mux.h"
#include "../demux/mp4/libmp4.h" /* flags */
-#include "../demux/mpeg/mpeg_parser_helpers.h"
#include "../packetizer/hevc_nal.h"
#include "../packetizer/h264_nal.h" /* h264_get_spspps */
#include "../packetizer/hxxx_nal.h"
@@ -33,6 +32,7 @@
#include <vlc_es.h>
#include <vlc_iso_lang.h>
+#include <vlc_bits.h>
#include <assert.h>
#include <time.h>
@@ -529,6 +529,32 @@ static void hevcParseVPS(uint8_t * p_buffer, size_t i_buffer, uint8_t *general,
general[i] = bs_read( &bs, 8 );
}
+static inline void hevc_skip_profile_tiers_level( bs_t * bs, int32_t max_sub_layer_minus1 )
+{
+ uint8_t sub_layer_profile_present_flag[8];
+ uint8_t sub_layer_level_present_flag[8];
+
+ /* skipping useless fields of the VPS see https://www.itu.int/rec/dologin_pub.asp?lang=e&id=T-REC-H.265-201304-I!!PDF-E&type=item */
+ bs_skip( bs, 2 + 1 + 5 + 32 + 1 + 1 + 1 + 1 + 44 + 8 );
+
+ for( int32_t i = 0; i < max_sub_layer_minus1; i++ )
+ {
+ sub_layer_profile_present_flag[i] = bs_read1( bs );
+ sub_layer_level_present_flag[i] = bs_read1( bs );
+ }
+
+ if(max_sub_layer_minus1 > 0)
+ bs_skip( bs, (8 - max_sub_layer_minus1) * 2 );
+
+ for( int32_t i = 0; i < max_sub_layer_minus1; i++ )
+ {
+ if( sub_layer_profile_present_flag[i] )
+ bs_skip( bs, 2 + 1 + 5 + 32 + 1 + 1 + 1 + 1 + 44 );
+ if( sub_layer_level_present_flag[i] )
+ bs_skip( bs, 8 );
+ }
+}
+
static void hevcParseSPS(uint8_t * p_buffer, size_t i_buffer, uint8_t * chroma_idc,
uint8_t *bit_depth_luma_minus8, uint8_t *bit_depth_chroma_minus8)
{
More information about the vlc-commits
mailing list