H264 mpeg2,4 frame

一般在开头有一个单元分隔符NAL,两个单元分隔符之间的数据包就是一帧图像。就是00 00 01 09,这个09就是单元分隔符的标志。不过协议并没有说NAL流必须如此组织,可能还有其它的组织形式。我手头的H264文件都是这样组织的。

 

H264的字节流确实没有帧的概念.具体原因请仔细研读协议.

 

这个要看你怎么理解了。和MPEG2、MPEG4相比,H.264字节流中帧的形式发生了变化。以视频帧为例,MPEG2和MPEG4字节流在传输的时候提取帧的关键参数,将其封装入传输包首部,比如TS包或RTP包,而包负载中的数据仍然是一个完整的图像帧。也就是说,你即使不使用包首部中所设置的关于包负载的参数信息,也能够根据包负载中的帧数据本身进行正确的解码。


而H.264码流本身对图像数据就做了处理,将一个完整的图像帧进行分解,抽出序列参数集、图像参数集等帧信息,放到各自对应的NAL中,而图像数据本身则封装进编码条带中。这样,在NAL流中,仅仅根据编码条带NAL单元是解析不出图像来的,必须和序列参数集、图像参数集NAL配合才能解出。也就是说,MPEG2、MPEG4编码的一帧数据,被分解成了H.264中的多个NAL单元,H.264编码的抽象化程度更高了。但是H.264码流在组织的时候仍然是以一帧数据为单位的,它并不会将多帧数据交织到一起,只不过表现在形式上,需要用多个NAL单元才能组成一个完整的数据帧。


转自http://hi.baidu.com/ccqi0000/blog/item/f6d26249d9c7d517b2de052e.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
合成源码流程 1.合成函数 --merge_with_h264() 2.流程 1)初始化重要参数值见下表 序号 参数 代表意思 1 got_video 标志位,合成TS流中是否有视频流;有为TRUE,否则false 2 got_audio 标志位,合成TS流中是否有音频流;有为TRUE,否则false 3 prog_pids[] 音视频PID,都有取2个,只有视频或音频取1。 4 prog_type[] 音视频流类型,都有取2个;如只要视频H264码流则 prog_type[0] = AVC_VIDEO_STREAM_TYPE;(0x1B) 2.取音频prog_type[]的值 代码: switch (audio_type) { case AUDIO_ADTS: case AUDIO_ADTS_MPEG2: case AUDIO_ADTS_MPEG4: prog_type[1] = ADTS_AUDIO_STREAM_TYPE; break; case AUDIO_L2: prog_type[1] = MPEG2_AUDIO_STREAM_TYPE; break; case AUDIO_AC3: prog_type[1] = ATSC_DOLBY_AUDIO_STREAM_TYPE; break; default: // what else can we do? prog_type[1] = ADTS_AUDIO_STREAM_TYPE; break; } 3连续写出八个TS流空包------ write_TS_null_packet(TS_writer_poutput) 代码 write_TS_null_packet(TS_writer_p output) { byte TS_packet[TS_PACKET_SIZE]; int err, ii; TS_packet[0] = 0x47; TS_packet[1] = 0x1F; // PID is 0x1FFF TS_packet[2] = 0xFF; TS_packet[3] = 0x20; // payload only for (ii=4; ii<TS_PACKET_SIZE; ii++) TS_packet[ii] = 0xFF; err = write_TS_packet_parts(output,TS_packet,TS_PACKET_SIZE,NULL,0,NULL,0,0x1FF,FALSE,0); if (err) { fprintf(stderr,"### Error writing null TS packet\n"); return 1; } return 0; }<span style="font-weight: bold;"> </span> 注:空包包头 0x47 0x1F 0xFF 0x20 包数据全为0xff。包长188个字节 4.为多种类型(音频、视频流)写出pat和PMT--- write_TS_program_data2() 具体如何写参考write_pat_and_pmt()、append_to_pidint_list()等函数 5.判断got_video 、got_audio是否为true(即是否任何一个存在),存在在进行循环合成 while (got_video || got_audio) { ...... } 6.具体合成 具体合成分两步:1. write_TS_program_data2()----------------写出PMT和PAT 2.根据H264码流的帧类型(I帧和非I帧),添加PTS/DTS和pcr 代码如下: <strong> </strong> if (is_I_or_IDR_frame(access_unit)) //判断是否是I帧,I帧则pts/dts ;否则打pcr err = write_access_unit_as_TS_with_pts_dts(access_unit,video_context, output,DEFAULT_VIDEO_PID, TRUE,video_pts+45000, TRUE,video_pts);
mpeg2encode / mpeg2decode<br> =========================<br> MPEG-2 Encoder / Decoder, Version 1.2, July 19, 1996<br><br> Copyright (c) 1996 <br> MPEG Software Simulation Group<br><br> E-mail: mssg@mpeg.org (author contact)<br> Web: http://www.mpeg.org/MSSG/<br> FTP: ftp://ftp.mpeg.org/pub/mpeg/mssg/<br><br><br>Contents:<br>1. Overview<br>2. Introduction<br>3. Contacting the MPEG Software Simulation Group<br>4. Availability <br>5. Installation<br>6. Acknowledgements<br>7. History of the technical report<br><br><br>1. Overview<br>===========<br><br>This directory contains our implementation of an ISO/IEC DIS 13818-2<br>codec. It converts uncompressed video frames into MPEG-1 and MPEG-2<br>video coded bitstream sequences, and vice versa.<br><br>The files mpeg2enc.doc and mpeg2dec.doc in the doc/ directory contain<br>further information about the codec. The directory verify/ contains<br>a small set of verification pictures, a small bitstream, and Unix <br>shell script to automatically test the output of the encoder and decoder.<br><br>A precompiled version of the programs for Win32s (Windows NT/95) will<br>be made available later date, although it is trivial to make a console<br>application from the encoder and decoder with most Win32s compilers<br>(such as Microsoft Visual C++).<br><br>Subdirectories src/mpeg2enc and src/mpeg2dec contain the source code<br>for the encoder and decoder, subdirectory par/ contains a couple of<br>example encoder parameter files for 25 and 30 frames/sec MPEG-2 and<br>MPEG-1 video.<br><br>Summary of changes since July 4, 1994 release:<br><br>This is only the second official release of our MPEG-2 video software.<br>Only minor bug corrections have been added to the encoder. We still do<br>not implement scalable encoding, as this is mostly useful only for<br>academic research.<br><br>The decoder has been updated to meet the final MPEG specification,<br>although the old decoder will still reconstruct Main Profile and MPEG-1<br>bitstreams just fine. The current decoder implements the most<br>important case of Spatial scalability, as well as SNR and Data<br>Partitioning. Temporal scalability is not implemented.<br><br>2. Introduction<br>===============<br><br>MPEG-2 Video is a generic method for compressed representation of video<br>sequences using a common coding syntax defined in the document ISO/IEC<br>13818 Part 2 by the International Organization for Standardization<br>(ISO) and the International Electrotechnical Commission (IEC), in<br>collaboration with the International Telecommunications Union (ITU) as<br>Recommendation H.262. The MPEG-2 concept is similar to MPEG-1, but<br>includes extensions to cover a wider range of applications.<br><br>The primary application targeted during the MPEG-2 definition process<br>was the all-digital transmission of interlaced broadcast TV quality<br>video at coded bitrates between 4 and 9 Mbit/sec. However, the MPEG-2<br>syntax has been found to be efficient for other applications such as<br>those at higher bit rates and sample rates (e.g. HDTV). <br><br>The most significant enhancement over MPEG-1 is the addition of syntax<br>for efficient coding of interlaced video (e.g. 16x8 block sizes for<br>motion compensation, field dct organization, Dual Prime prediction, et<br>al). Several other more subtle enhancements (e.g. 10-bit DCT DC<br>precision, non-linear macroblock scale quantizer, intra VLC tables,<br>improved IDCT mismatch control) were adopted which have a moderate <br>improvement in coding efficiency.... even for progressive video sequences.<br><br>Other key features of MPEG-2 are the scalable extensions which permit<br>the division of a continuous video signal into two or more coded bitstreams <br>representing the video at different resolutions (spatial scalability), <br>picture quality (SNR scalability and data partioning), or frame <br>rates (temporal scalability).<br><br>The MPEG Software Simulation Group is currently developing MPEG<br>software with the purpose of providing aid in understanding the various<br>algorithms which comprise an encoder and decoder, and giving a sample<br>implementation based on advanced encoding models. The MPEG-2 software<br>project is an on-going development. Since the current version of the<br>encoder already employs a reasonable (and the most popular) subset of<br>the MPEG-2 signal coding toolkit (MPEG-1 and MPEG-2 Main Profile), and <br>there appears to be sufficient public interest, we have decided to make <br>a public release of the code.<br><br>The encoder can also be used for generating good quality constant<br>bitrate MPEG-1 sequences and is (to our knowledge) the first publicly<br>available encoder based on the relatively sophisticated TM5 coding model.<br><br><br>3. Contacting the MPEG Software Simulation Group<br>================================================<br><br>We welcome any project-specific questions, comments, suggestions, bug<br>reports etc. They should be sent to the Internet E-mail address: <br><br> mssg@mpeg.org<br><br>which automatically forwards to the software authors.<br><br>4. Availability<br>===============<br><br>The most recent version of the codec source code is available by anonymous<br>ftp from:<br><br> ftp://ftp.mpeg.org/pub/mpeg/mssg/<br><br>The directory contains the following files:<br><br> mpeg2vidcodec_v12.tar.gz codec source code and documentation<br> mpeg2v12.zip source code and Win32s executables<br> <br>You need gunzip (GNU zip/unzip) to uncompress the .gz and .zip archives.<br><br>5. Installation<br>===============<br><br>mpeg2decode and mpeg2encode have been compiled and tested on the following<br>platforms:<br><br> - SUN SPARCstation 10, SunOS 4.1.3, (gcc compiler)<br> - '386-PC, MSDOS 5.0, djgpp v1.11, gcc v2.5.7 and MS Visual C++ 4.0<br><br>The source code should compile without major modifications on other 32<br>bit systems with ANSI C compliant compilers. Systems with 16 bit 'int'<br>variables or segmented memory models are not supported.<br><br>Please report any modifications you had to apply in order to install the<br>programs on your system to the address mssg@mpeg.org <br><br>The encoder and decoder are kept in separate sub-directories,<br>src/mpeg2dec contains the decoder, while src/mpeg2enc contains the<br>encoder sources. The following installation procedure applies to both<br>the encoder and the decoder:<br><br><br>Step 1: edit Makefile<br>---------------------<br><br>You may have to set CC to your C compiler and CFLAGS to the flags required<br>by the compiler. It is sufficient to set these variables in the top directory<br>Makefile. They are propagated to the individual Makefiles of the encoder<br>and decoder. Any other changes have to be applied to the individual Makefiles,<br>however.<br><br>You can compile the decoder with or without X11 output. Please follow the<br>instructions in the top-level Makefile to activate X Window System support.<br><br>Step 2: edit src/mpeg2dec/config.h<br>----------------------------------<br><br>In most cases, no modification should be required. If your C library<br>doesn't accept "rb" / "wb" parameters in fopen() (required to disable<br>LF <-> CR/LF conversion on MSDOS systems), change the #defines RB and WB<br>to "r" and "w".<br><br><br>Step 3: make<br>------------<br><br>Type 'make' from the top directory (mpeg2). On a PC with DJGPP installed you<br>have to enter 'make pc' in the individual source directories to produce<br>.exe files.<br><br><br>Step 4: verification<br>--------------------<br><br>In the mpeg/verify directory, you can verify correct compilation of the<br>codec by typing 'make test'. No differences should be reported. The<br>only comparison which is allowed to fail is between test.m2v and<br>new.m2v, caused by floating point accuracy dependencies in the forward<br>DCT.<br><br><br>6. Acknowledgements<br>===================<br>Authors of the current release are:<br><br> Stefan Eckart <[email protected]><br> Chad Fogg <[email protected]><br><br>420to422, 422to444 scaling filters:<br> Cheung Auyeung <[email protected]><br><br>Windows 32s port:<br> Sorin Papuc <[email protected]><br><br>Special thanks are due to<br><br> - J. Steurer, M. Oepen, IRT (Institut fuer Rundfunktechnik, Muenchen):<br> for contributing motion estimation speed improvements (distance<br> computation short-circuit in conjunction with spiral search, cf.<br> dist1(), fullsearch())<br><br> - Tristan Savatier <tristan@mpeg.org> for his help on numerous <br> improvements, suggestions, and features.<br><br> Numerous users:<br> for providing bug reports and Makefiles<br><br>7. History of Technical Report Project<br>======================================<br><br>The Technical Report, a document which primarily consists of<br>a C source code program, was initiated by the MPEG committee to: <br><br> - Provide an example of MPEG video syntax being intelligently employed <br> to generate good quality video bitstreams.<br> - A reference tool for implementors<br> - Aid in understanding the MPEG specification <br> - decoder which employs full arithmetic accuracy.<br><br>----<br>End of Readme file<br>
E.M. Magic Swf2Avi Professional, High-Quality, No skip frames and Lossless audio for your Flash conversion, and supports swf to HD(high-definition) video. E.M. Magic Swf2Avi is the extremely powerful Flash converter software to convert SWF to AVI and other popular formats. The software is designed to convert swf for your mobile video player as avi, 3gp, mp4, mp3, PSP, PS3, iPod, iPhone, Apple TV, XBOX 360, Zune etc and also CD, VCD or DVD player. In particular, E.M. Magic Swf2Avi can help u convert swf to HD (high definition) video formats like HD WMV Video, HD DivX Video, HD Xvid Video, HD H.264 Video, HD Quick Time Video, HD MPEG4 Video, HD FLV Video, HD TS Video, and create Blu-ray folder for PS3 and Blu-ray player. Update: 2009-01-15 Magic Swf2Avi V6.0.9.115 1. HD version, convert swf to HD (high-definition) video for PS3 and Blu-ray Player 2. updated converting engine. 3. updated media burner, supports burn data dvd now. 4. bug fixes. 2008-10-15 Magic Swf2Avi 2008 build 5.2.10.115 1. added BlackBerry output format. 2. updated converting engine. 3. updated gif quality. 4. bug fixes. 2008-09-10 Magic Swf2Avi 2008 build 5.2.9.101 1. update interface. 2. bug fixes. 2008-08-27 Magic Swf2Avi 2008 build 5.2.7.281 1. update interface. 2. bug fixes. 2008-06-20 Magic Swf2Avi 2008 build 5.1.6.417 1. Added a command line version. 2. Added output format: MKV. 3. Updated help file. 4. Bug fixes. 2008-05-21 Magic Swf2Avi 2008 build 5.0.8.521 1. Bug fixes. 2008-04-08 Magic Swf2Avi 2008 build 5.0.8.408 1. Bug fixes. 2008-03-12 Magic Swf2Avi 2008 build 5.0.8.315 1. Bug fixes. 2008-01-22 Magic Swf2Avi 2008 build 5.0.8.118 1. Added option to convert Flash(swf) game. Main Functions: . Three output mode(Auto/two compressions/a compression), you can high-quality, simple, rapid convert flash file. . One step to convert flash(swf) to your iPod, PSP, Zune, 3GP mobile phone(Nokia, Sony Ericsson, Motorola), Apple TV, iPhone, etc. . Convert and Burn flash(swf) file to DVD, SVC
VisioForge Video Edit SDK major features include: Input formats video formats - AVI, MPEG-1/2, WMV, 3GP, QuickTime MOV, MPEG-4/H264 (AVC), any other if you have corresponding decoder audio formats - WAV, MP3, OGG, WMA, AAC, any other if you have corresponding decoder images - BMP, PNG, GIF, JPEG, TIFF Add a lot of audio/video files and images Adding various parts of video and audio files to the timeline Video processing and effects image and graphic overlays text overlay video transparency brightness, contrast, saturation, hue, etc. deinterlace denoise pan / zoom resize to any resolution chroma-key 3-rd party DirectShow filters support Transition effects between tracks (above 80, same as in Windows Movie Maker) Motion detection Video encryption Encoding parameters video size frame rate video and audio codecs video and audio bit rate other Audio processing and effects volume booster equalizer 3D-bass system other effects Output video formats: AVI WMV (using built-in or external profiles or specifying all parameters directly) MKV (Matroska) WebM MPEG 1/2 (VCD/SVCD/DVD), MPEG-4 (iPod/iPhone), FLV, using FFMPEG any other formats via third-party filters (e.g. MPEG1, MPEG2, MPEG4/H264, 3GP) MP4 H264 / AAC Output audio formats WAV (PCM or ACM codecs) OGG Vorbis MP3 (LAME) Windows Media Audio Development platforms: Visual Studio 2005 and later: Visual C#, Visual C++, Visual Basic .NET Delphi 6 / 7 / 2005 / 2006 / 2007 / 2009 / 2010 / XE / XE2 / XE3 / XE4 / XE5 / XE6 / XE7 / XE8 / 10 / 10.1 / 10.2 Visual Studio 6: Visual C++, Visual Basic 6 Borland C++ Builder 5 and later may be used with other ActiveX compatible applications like Microsoft Access, Word, Excel, FrontPage, Powerbuilder, etc. x86 and x64 versions System requirements Windows 10, Windows 8/8.1, Windows 7, Windows Vista, Windows XP, Windows Server 2003 and later .Net Framework 2.0 or later (for some demo applications) DirectX 9 or later Distribution rights Royalty-free distribution. Trial limitations Trial versi
Contents Page 0 Introduction.............................................................................................................................................................. xiv 0.1 Prologue............................................................................................................................................................. xiv 0.2 Purpose .............................................................................................................................................................. xiv 0.3 Applications ....................................................................................................................................................... xiv 0.4 Publication and versions of this International Standard..................................................................................... xiv 0.5 Profiles and levels............................................................................................................................................... xv 0.6 Overview of the design characteristics ............................................................................................................... xv 0.6.1 Predictive coding ........................................................................................................................................ xv 0.6.2 Coding of progressive and interlaced video............................................................................................... xvi 0.6.3 Picture partitioning into macroblocks and smaller partitions..................................................................... xvi 0.6.4 Spatial redundancy reduction..................................................................................................................... xvi 0.7 How to read this specification............................................................................................................................ xvi 1 Scope ............................................................................................................................................................................ 1 2 Normative references.................................................................................................................................................. 1 3 Definitions.................................................................................................................................................................... 1 4 Abbreviations .............................................................................................................................................................. 9 5 Conventions ............................................................................................................................................................... 10 5.1 Arithmetic operators ........................................................................................................................................... 10 5.2 Logical operators ................................................................................................................................................ 10 5.3 Relational operators ............................................................................................................................................ 11 5.4 Bit-wise operators ............................................................................................................................................... 11 5.5 Assignment operators.......................................................................................................................................... 11 5.6 Range notation .................................................................................................................................................... 11 5.7 Mathematical functions....................................................................................................................................... 11 5.8 Variables, syntax elements, and tables................................................................................................................ 12 5.9 Text description of logical operations................................................................................................................. 13 5.10 Processes............................................................................................................................................................. 14 6 Source, coded, decoded and output data formats, scanning processes, and neighbouring relationships.......... 14 6.1 Bitstream formats................................................................................................................................................ 14 6.2 Source, decoded, and output picture formats ...................................................................................................... 15 6.3 Spatial subdivision of pictures and slices............................................................................................................ 20 6.4 Inverse scanning processes and derivation processes for neighbours ................................................................. 20 6.4.1 Inverse macroblock scanning process......................................................................................................... 21 6.4.2 Inverse macroblock partition and sub-macroblock partition scanning process........................................... 21 6.4.2.1 Inverse macroblock partition scanning process....................................................................................... 22 6.4.2.2 Inverse sub-macroblock partition scanning process................................................................................ 22 6.4.3 Inverse 4x4 luma block scanning process ................................................................................................... 23 6.4.4 Inverse 8x8 luma block scanning process ................................................................................................... 23 6.4.5 Derivation process of the availability for macroblock addresses................................................................ 23 6.4.6 Derivation process for neighbouring macroblock addresses and their availability..................................... 24 6.4.7 Derivation process for neighbouring macroblock addresses and their availability in MBAFF frames....... 24 6.4.8 Derivation processes for neighbouring macroblocks, blocks, and partitions .............................................. 25 6.4.8.1 Derivation process for neighbouring macroblocks ................................................................................. 26 6.4.8.2 Derivation process for neighbouring 8x8 luma block ............................................................................. 26 6.4.8.3 Derivation process for neighbouring 4x4 luma blocks............................................................................ 27 6.4.8.4 Derivation process for neighbouring 4x4 chroma blocks........................................................................ 28 6.4.8.5 Derivation process for neighbouring partitions....................................................................................... 28 6.4.9 Derivation process for neighbouring locations ........................................................................................... 30 6.4.9.1 Specification for neighbouring locations in fields and non-MBAFF frames .......................................... 30 6.4.9.2 Specification for neighbouring locations in MBAFF frames .................................................................. 31 NEN-ISO/IEC 14496-10:2006-09 Dit document is door NEN onder licentie verstrekt aan: / This document has been supplied under license by NEN to: Irdeto Access . 2006/10/30 ISO/IEC 14496-10:2005(E) iv © ISO/IEC 2005 – All rights reserved 7 Syntax and semantics................................................................................................................................................33 7.1 Method of describing syntax in tabular form ......................................................................................................33 7.2 Specification of syntax functions, categories, and descriptors............................................................................34 7.3 Syntax in tabular form.........................................................................................................................................36 7.3.1 NAL unit syntax..........................................................................................................................................36 7.3.2 Raw byte sequence payloads and RBSP trailing bits syntax.......................................................................37 7.3.2.1 Sequence parameter set RBSP syntax .....................................................................................................37 7.3.2.1.1 Scaling list syntax.............................................................................................................................38 7.3.2.1.2 Sequence parameter set extension RBSP syntax ..............................................................................39 7.3.2.2 Picture parameter set RBSP syntax .........................................................................................................39 7.3.2.3 Supplemental enhancement information RBSP syntax ...........................................................................40 7.3.2.3.1 Supplemental enhancement information message syntax.................................................................41 7.3.2.4 Access unit delimiter RBSP syntax.........................................................................................................41 7.3.2.5 End of sequence RBSP syntax ................................................................................................................41 7.3.2.6 End of stream RBSP syntax ....................................................................................................................41 7.3.2.7 Filler data RBSP syntax ..........................................................................................................................42 7.3.2.8 Slice layer without partitioning RBSP syntax .........................................................................................42 7.3.2.9 Slice data partition RBSP syntax.............................................................................................................42 7.3.2.9.1 Slice data partition A RBSP syntax..................................................................................................42 7.3.2.9.2 Slice data partition B RBSP syntax ..................................................................................................42 7.3.2.9.3 Slice data partition C RBSP syntax ..................................................................................................43 7.3.2.10 RBSP slice trailing bits syntax ..............................................................................................................43 7.3.2.11 RBSP trailing bits syntax.......................................................................................................................43 7.3.3 Slice header syntax......................................................................................................................................44 7.3.3.1 Reference picture list reordering syntax..................................................................................................45 7.3.3.2 Prediction weight table syntax ................................................................................................................46 7.3.3.3 Decoded reference picture marking syntax .............................................................................................47 7.3.4 Slice data syntax..........................................................................................................................................48 7.3.5 Macroblock layer syntax .............................................................................................................................49 7.3.5.1 Macroblock prediction syntax .................................................................................................................50 7.3.5.2 Sub-macroblock prediction syntax..........................................................................................................51 7.3.5.3 Residual data syntax................................................................................................................................52 7.3.5.3.1 Residual block CAVLC syntax ........................................................................................................53 7.3.5.3.2 Residual block CABAC syntax ........................................................................................................55 7.4 Semantics ............................................................................................................................................................56 7.4.1 NAL unit semantics.....................................................................................................................................56 7.4.1.1 Encapsulation of an SODB within an RBSP (informative).....................................................................58 7.4.1.2 Order of NAL units and association to coded pictures, access units, and video sequences ....................59 7.4.1.2.1 Order of sequence and picture parameter set RBSPs and their activation........................................59 7.4.1.2.2 Order of access units and association to coded video sequences......................................................60 7.4.1.2.3 Order of NAL units and coded pictures and association to access units ..........................................61 7.4.1.2.4 Detection of the first VCL NAL unit of a primary coded picture.....................................................62 7.4.1.2.5 Order of VCL NAL units and association to coded pictures ............................................................63 7.4.2 Raw byte sequence payloads and RBSP trailing bits semantics..................................................................63 7.4.2.1 Sequence parameter set RBSP semantics................................................................................................63 7.4.2.1.1 Scaling list semantics .......................................................................................................................68 7.4.2.1.2 Sequence parameter set extension RBSP semantics.........................................................................69 7.4.2.2 Picture parameter set RBSP semantics....................................................................................................70 7.4.2.3 Supplemental enhancement information RBSP semantics......................................................................73 7.4.2.3.1 Supplemental enhancement information message semantics ...........................................................73 7.4.2.4 Access unit delimiter RBSP semantics....................................................................................................73 7.4.2.5 End of sequence RBSP semantics ...........................................................................................................73 7.4.2.6 End of stream RBSP semantics ...............................................................................................................74 7.4.2.7 Filler data RBSP semantics .....................................................................................................................74 7.4.2.8 Slice layer without partitioning RBSP semantics....................................................................................74 7.4.2.9 Slice data partition RBSP semantics .......................................................................................................74 7.4.2.9.1 Slice data partition A RBSP semantics.............................................................................................74 7.4.2.9.2 Slice data partition B RBSP semantics.............................................................................................74 7.4.2.9.3 Slice data partition C RBSP semantics.............................................................................................74 NEN-ISO/IEC 14496-10:2006-09 Dit document is door NEN onder licentie verstrekt aan: / This document has been supplied under license by NEN to: Irdeto Access . 2006/10/30 ISO/IEC 14496-10:2005(E) © ISO/IEC 2005 – All rights reserved v 7.4.2.10 RBSP slice trailing bits semantics......................................................................................................... 75 7.4.2.11 RBSP trailing bits semantics ................................................................................................................. 75 7.4.3 Slice header semantics ................................................................................................................................ 75 7.4.3.1 Reference picture list reordering semantics ............................................................................................ 81 7.4.3.2 Prediction weight table semantics........................................................................................................... 82 7.4.3.3 Decoded reference picture marking semantics........................................................................................ 82 7.4.4 Slice data semantics .................................................................................................................................... 85 7.4.5 Macroblock layer semantics........................................................................................................................ 86 7.4.5.1 Macroblock prediction semantics ........................................................................................................... 93 7.4.5.2 Sub-macroblock prediction semantics .................................................................................................... 94 7.4.5.3 Residual data semantics .......................................................................................................................... 96 7.4.5.3.1 Residual block CAVLC semantics................................................................................................... 97 7.4.5.3.2 Residual block CABAC semantics................................................................................................... 97 8 Decoding process....................................................................................................................................................... 98 8.1 NAL unit decoding process................................................................................................................................. 99 8.2 Slice decoding process........................................................................................................................................ 99 8.2.1 Decoding process for picture order count ................................................................................................... 99 8.2.1.1 Decoding process for picture order count type 0 .................................................................................. 101 8.2.1.2 Decoding process for picture order count type 1 .................................................................................. 102 8.2.1.3 Decoding process for picture order count type 2 .................................................................................. 103 8.2.2 Decoding process for macroblock to slice group map .............................................................................. 104 8.2.2.1 Specification for interleaved slice group map type ............................................................................... 105 8.2.2.2 Specification for dispersed slice group map type.................................................................................. 105 8.2.2.3 Specification for foreground with left-over slice group map type ........................................................ 105 8.2.2.4 Specification for box-out slice group map types................................................................................... 106 8.2.2.5 Specification for raster scan slice group map types .............................................................................. 106 8.2.2.6 Specification for wipe slice group map types ....................................................................................... 106 8.2.2.7 Specification for explicit slice group map type..................................................................................... 107 8.2.2.8 Specification for conversion of map unit to slice group map to macroblock to slice group map ......... 107 8.2.3 Decoding process for slice data partitioning ............................................................................................. 107 8.2.4 Decoding process for reference picture lists construction......................................................................... 108 8.2.4.1 Decoding process for picture numbers.................................................................................................. 108 8.2.4.2 Initialisation process for reference picture lists..................................................................................... 109 8.2.4.2.1 Initialisation process for the reference picture list for P and SP slices in frames........................... 109 8.2.4.2.2 Initialisation process for the reference picture list for P and SP slices in fields............................. 110 8.2.4.2.3 Initialisation process for reference picture lists for B slices in frames........................................... 110 8.2.4.2.4 Initialisation process for reference picture lists for B slices in fields............................................. 111 8.2.4.2.5 Initialisation process for reference picture lists in fields ................................................................ 112 8.2.4.3 Reordering process for reference picture lists....................................................................................... 113 8.2.4.3.1 Reordering process of reference picture lists for short-term reference pictures............................. 113 8.2.4.3.2 Reordering process of reference picture lists for long-term reference pictures.............................. 114 8.2.5 Decoded reference picture marking process ............................................................................................. 114 8.2.5.1 Sequence of operations for decoded reference picture marking process............................................... 115 8.2.5.2 Decoding process for gaps in frame_num............................................................................................. 115 8.2.5.3 Sliding window decoded reference picture marking process ................................................................ 116 8.2.5.4 Adaptive memory control decoded reference picture marking process ................................................ 116 8.2.5.4.1 Marking process of a short-term reference picture as “unused for reference” ............................... 116 8.2.5.4.2 Marking process of a long-term reference picture as “unused for reference” ................................ 117 8.2.5.4.3 Assignment process of a LongTermFrameIdx to a short-term reference picture ........................... 117 8.2.5.4.4 Decoding process for MaxLongTermFrameIdx ............................................................................. 117 8.2.5.4.5 Marking process of all reference pictures as “unused for reference” and setting MaxLongTermFrameIdx to “no long-term frame indices”............................................................................... 118 8.2.5.4.6 Process for assigning a long-term frame index to the current picture ............................................ 118 8.3 Intra prediction process..................................................................................................................................... 118 8.3.1 Intra_4x4 prediction process for luma samples......................................................................................... 119 8.3.1.1 Derivation process for the Intra4x4PredMode ...................................................................................... 119 8.3.1.2 Intra_4x4 sample prediction.................................................................................................................. 121 8.3.1.2.1 Specification of Intra_4x4_Vertical prediction mode .................................................................... 122 8.3.1.2.2 Specification of Intra_4x4_Horizontal prediction mode ................................................................ 122 8.3.1.2.3 Specification of Intra_4x4_DC prediction mode............................................................................ 122 NEN-ISO/IEC 14496-10:2006-09 Dit document is door NEN onder licentie verstrekt aan: / This document has been supplied under license by NEN to: Irdeto Access . 2006/10/30 ISO/IEC 14496-10:2005(E) vi © ISO/IEC 2005 – All rights reserved 8.3.1.2.4 Specification of Intra_4x4_Diagonal_Down_Left prediction mode ..............................................123 8.3.1.2.5 Specification of Intra_4x4_Diagonal_Down_Right prediction mode ............................................123 8.3.1.2.6 Specification of Intra_4x4_Vertical_Right prediction mode..........................................................123 8.3.1.2.7 Specification of Intra_4x4_Horizontal_Down prediction mode.....................................................124 8.3.1.2.8 Specification of Intra_4x4_Vertical_Left prediction mode............................................................124 8.3.1.2.9 Specification of Intra_4x4_Horizontal_Up prediction mode..........................................................124 8.3.2 Intra_8x8 prediction process for luma samples.........................................................................................125 8.3.2.1 Derivation process for Intra8x8PredMode ............................................................................................125 8.3.2.2 Intra_8x8 sample prediction..................................................................................................................127 8.3.2.2.1 Reference sample filtering process for Intra_8x8 sample prediction .............................................128 8.3.2.2.2 Specification of Intra_8x8_Vertical prediction mode.....................................................................129 8.3.2.2.3 Specification of Intra_8x8_Horizontal prediction mode ................................................................129 8.3.2.2.4 Specification of Intra_8x8_DC prediction mode............................................................................129 8.3.2.2.5 Specification of Intra_8x8_Diagonal_Down_Left prediction mode ..............................................130 8.3.2.2.6 Specification of Intra_8x8_Diagonal_Down_Right prediction mode ............................................130 8.3.2.2.7 Specification of Intra_8x8_Vertical_Right prediction mode..........................................................130 8.3.2.2.8 Specification of Intra_8x8_Horizontal_Down prediction mode.....................................................131 8.3.2.2.9 Specification of Intra_8x8_Vertical_Left prediction mode............................................................131 8.3.2.2.10 Specification of Intra_8x8_Horizontal_Up prediction mode........................................................131 8.3.3 Intra_16x16 prediction process for luma samples.....................................................................................132 8.3.3.1 Specification of Intra_16x16_Vertical prediction mode .......................................................................133 8.3.3.2 Specification of Intra_16x16_Horizontal prediction mode ...................................................................133 8.3.3.3 Specification of Intra_16x16_DC prediction mode...............................................................................133 8.3.3.4 Specification of Intra_16x16_Plane prediction mode ...........................................................................133 8.3.4 Intra prediction process for chroma samples.............................................................................................134 8.3.4.1 Specification of Intra_Chroma_DC prediction mode............................................................................134 8.3.4.2 Specification of Intra_Chroma_Horizontal prediction mode ................................................................136 8.3.4.3 Specification of Intra_Chroma_Vertical prediction mode ....................................................................136 8.3.4.4 Specification of Intra_Chroma_Plane prediction mode ........................................................................136 8.3.5 Sample construction process for I_PCM macroblocks..............................................................................137 8.4 Inter prediction process .....................................................................................................................................137 8.4.1 Derivation process for motion vector components and reference indices .................................................139 8.4.1.1 Derivation process for luma motion vectors for skipped macroblocks in P and SP slices ....................140 8.4.1.2 Derivation process for luma motion vectors for B_Skip, B_Direct_16x16, and B_Direct_8x8 ...........141 8.4.1.2.1 Derivation process for the co-located 4x4 sub-macroblock partitions............................................141 8.4.1.2.2 Derivation process for spatial direct luma motion vector and reference index prediction mode....144 8.4.1.2.3 Derivation process for temporal direct luma motion vector and reference index prediction mode 146 8.4.1.3 Derivation process for luma motion vector prediction..........................................................................148 8.4.1.3.1 Derivation process for median luma motion vector prediction.......................................................149 8.4.1.3.2 Derivation process for motion data of neighbouring partitions ......................................................150 8.4.1.4 Derivation process for chroma motion vectors......................................................................................151 8.4.2 Decoding process for Inter prediction samples .........................................................................................151 8.4.2.1 Reference picture selection process.......................................................................................................152 8.4.2.2 Fractional sample interpolation process ................................................................................................153 8.4.2.2.1 Luma sample interpolation process ................................................................................................154 8.4.2.2.2 Chroma sample interpolation process.............................................................................................157 8.4.2.3 Weighted sample prediction process.....................................................................................................158 8.4.2.3.1 Default weighted sample prediction process ..................................................................................158 8.4.2.3.2 Weighted sample prediction process ..............................................................................................159 8.5 Transform coefficient decoding process and picture construction process prior to deblocking filter process ..161 8.5.1 Specification of transform decoding process for 4x4 luma residual blocks ..............................................162 8.5.2 Specification of transform decoding process for luma samples of Intra_16x16 macroblock prediction mode 162 8.5.3 Specification of transform decoding process for 8x8 luma residual blocks ..............................................163 8.5.4 Specification of transform decoding process for chroma samples ............................................................164 8.5.5 Inverse scanning process for transform coefficients .................................................................................166 8.5.6 Inverse scanning process for 8x8 luma transform coefficients .................................................................167 8.5.7 Derivation process for the chroma quantisation parameters and scaling function ....................................169 NEN-ISO/IEC 14496-10:2006-09 Dit document is door NEN onder licentie verstrekt aan: / This document has been supplied under license by NEN to: Irdeto Access . 2006/10/30 ISO/IEC 14496-10:2005(E) © ISO/IEC 2005 – All rights reserved vii 8.5.8 Scaling and transformation process for luma DC transform coefficients for Intra_16x16 macroblock type ........................................................................................................................................................... 171 8.5.9 Scaling and transformation process for chroma DC transform coefficients.............................................. 171 8.5.10 Scaling and transformation process for residual 4x4 blocks ..................................................................... 173 8.5.11 Scaling and transformation process for residual 8x8 luma blocks ............................................................ 175 8.5.12 Picture construction process prior to deblocking filter process................................................................. 178 8.5.13 Residual colour transform process ............................................................................................................ 179 8.6 Decoding process for P macroblocks in SP slices or SI macroblocks............................................................... 179 8.6.1 SP decoding process for non-switching pictures....................................................................................... 180 8.6.1.1 Luma transform coefficient decoding process ...................................................................................... 180 8.6.1.2 Chroma transform coefficient decoding process................................................................................... 181 8.6.2 SP and SI slice decoding process for switching pictures .......................................................................... 182 8.6.2.1 Luma transform coefficient decoding process ...................................................................................... 183 8.6.2.2 Chroma transform coefficient decoding process................................................................................... 183 8.7 Deblocking filter process .................................................................................................................................. 184 8.7.1 Filtering process for block edges .............................................................................................................. 188 8.7.2 Filtering process for a set of samples across a horizontal or vertical block edge...................................... 189 8.7.2.1 Derivation process for the luma content dependent boundary filtering strength................................... 190 8.7.2.2 Derivation process for the thresholds for each block edge.................................................................... 191 8.7.2.3 Filtering process for edges with bS less than 4 ..................................................................................... 193 8.7.2.4 Filtering process for edges for bS equal to 4......................................................................................... 194 9 Parsing process........................................................................................................................................................ 195 9.1 Parsing process for Exp-Golomb codes ............................................................................................................ 195 9.1.1 Mapping process for signed Exp-Golomb codes ...................................................................................... 197 9.1.2 Mapping process for coded block pattern ................................................................................................. 197 9.2 CAVLC parsing process for transform coefficient levels ................................................................................. 200 9.2.1 Parsing process for total number of transform coefficient levels and trailing ones .................................. 201 9.2.2 Parsing process for level information ....................................................................................................... 205 9.2.2.1 Parsing process for level_prefix............................................................................................................ 206 9.2.3 Parsing process for run information.......................................................................................................... 206 9.2.4 Combining level and run information ....................................................................................................... 209 9.3 CABAC parsing process for slice data.............................................................................................................. 209 9.3.1 Initialisation process ................................................................................................................................. 210 9.3.1.1 Initialisation process for context variables............................................................................................ 211 9.3.1.2 Initialisation process for the arithmetic decoding engine...................................................................... 222 9.3.2 Binarization process.................................................................................................................................. 222 9.3.2.1 Unary (U) binarization process ............................................................................................................. 224 9.3.2.2 Truncated unary (TU) binarization process........................................................................................... 224 9.3.2.3 Concatenated unary/ k-th order Exp-Golomb (UEGk) binarization process......................................... 225 9.3.2.4 Fixed-length (FL) binarization process................................................................................................. 225 9.3.2.5 Binarization process for macroblock type and sub-macroblock type.................................................... 226 9.3.2.6 Binarization process for coded block pattern........................................................................................ 229 9.3.2.7 Binarization process for mb_qp_delta................................................................................................... 229 9.3.3 Decoding process flow.............................................................................................................................. 230 9.3.3.1 Derivation process for ctxIdx................................................................................................................ 230 9.3.3.1.1 Assignment process of ctxIdxInc using neighbouring syntax elements ......................................... 232 9.3.3.1.1.1 Derivation process of ctxIdxInc for the syntax element mb_skip_flag ................................... 232 9.3.3.1.1.2 Derivation process of ctxIdxInc for the syntax element mb_field_decoding_flag.................. 232 9.3.3.1.1.3 Derivation process of ctxIdxInc for the syntax element mb_type ........................................... 233 9.3.3.1.1.4 Derivation process of ctxIdxInc for the syntax element coded_block_pattern........................ 233 9.3.3.1.1.5 Derivation process of ctxIdxInc for the syntax element mb_qp_delta .................................... 234 9.3.3.1.1.6 Derivation process of ctxIdxInc for the syntax elements ref_idx_l0 and ref_idx_l1............... 234 9.3.3.1.1.7 Derivation process of ctxIdxInc for the syntax elements mvd_l0 and mvd_l1 ....................... 235 9.3.3.1.1.8 Derivation process of ctxIdxInc for the syntax element intra_chroma_pred_mode................ 237 9.3.3.1.1.9 Derivation process of ctxIdxInc for the syntax element coded_block_flag ............................ 237 9.3.3.1.1.10 Derivation process of ctxIdxInc for the syntax element transform_size_8x8_flag ............... 238 9.3.3.1.2 Assignment process of ctxIdxInc using prior decoded bin values.................................................. 239 9.3.3.1.3 Assignment process of ctxIdxInc for syntax elements significant_coeff_flag, last_significant_coeff_flag, and coeff_abs_level_minus1 ................................................................................ 239 9.3.3.2 Arithmetic decoding process................................................................................................................. 242 NEN-ISO/IEC 14496-10:2006-09 Dit document is door NEN onder licentie verstrekt aan: / This document has been supplied under license by NEN to: Irdeto Access . 2006/10/30 ISO/IEC 14496-10:2005(E) viii © ISO/IEC 2005 – All rights reserved 9.3.3.2.1 Arithmetic decoding process for a binary decision ........................................................................243 9.3.3.2.1.1 State transition process ............................................................................................................243 9.3.3.2.2 Renormalization process in the arithmetic decoding engine ..........................................................246 9.3.3.2.3 Bypass decoding process for binary decisions ...............................................................................247 9.3.3.2.4 Decoding process for binary decisions before termination.............................................................247 9.3.4 Arithmetic encoding process (informative)...............................................................................................248 9.3.4.1 Initialisation process for the arithmetic encoding engine (informative)................................................248 9.3.4.2 Encoding process for a binary decision (informative)...........................................................................248 9.3.4.3 Renormalization process in the arithmetic encoding engine (informative)...........................................249 9.3.4.4 Bypass encoding process for binary decisions (informative) ................................................................251 9.3.4.5 Encoding process for a binary decision before termination (informative) ............................................252 9.3.4.6 Byte stuffing process (informative).......................................................................................................254 Annex A Profiles and levels............................................................................................................................................255 A.1 Requirements on video decoder capability........................................................................................................255 A.2 Profiles ..............................................................................................................................................................255 A.2.1 Baseline profile .........................................................................................................................................255 A.2.2 Main profile...............................................................................................................................................256 A.2.3 Extended profile ........................................................................................................................................256 A.2.4 High profile ...............................................................................................................................................256 A.2.5 High 10 profile ..........................................................................................................................................257 A.2.6 High 4:2:2 profile......................................................................................................................................257 A.2.7 High 4:4:4 profile......................................................................................................................................258 A.3 Levels................................................................................................................................................................258 A.3.1 Level limits common to the Baseline, Main, and Extended profiles.........................................................258 A.3.2 Level limits common to the High, High 10, High 4:2:2, and High 4:4:4 profiles.....................................260 A.3.3 Profile-specific level limits .......................................................................................................................261 A.3.3.1 Baseline profile limits...........................................................................................................................262 A.3.3.2 Main, High, High 10, High 4:2:2, or High 4:4:4 profile limits.............................................................263 A.3.3.3 Extended Profile Limits........................................................................................................................264 A.3.4 Effect of level limits on frame rate (informative)......................................................................................266 Annex B Byte stream format..........................................................................................................................................269 B.1 Byte stream NAL unit syntax and semantics ....................................................................................................269 B.1.1 Byte stream NAL unit syntax....................................................................................................................269 B.1.2 Byte stream NAL unit semantics...............................................................................................................269 B.2 Byte stream NAL unit decoding process...........................................................................................................270 B.3 Decoder byte-alignment recovery (informative) ...............................................................................................270 Annex C Hypothetical reference decoder .....................................................................................................................272 C.1 Operation of coded picture buffer (CPB) ..........................................................................................................274 C.1.1 Timing of bitstream arrival .......................................................................................................................274 C.1.2 Timing of coded picture removal ..............................................................................................................275 C.2 Operation of the decoded picture buffer (DPB) ................................................................................................276 C.2.1 Decoding of gaps in frame_num and storage of "non-existing" frames....................................................276 C.2.2 Picture decoding and output......................................................................................................................276 C.2.3 Removal of pictures from the DPB before possible insertion of the current picture.................................277 C.2.4 Current decoded picture marking and storage...........................................................................................277 C.2.4.1 Marking and storage of a reference decoded picture into the DPB.......................................................277 C.2.4.2 Storage of a non-reference picture into the DPB ..................................................................................277

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值