--- 1/draft-ietf-cellar-ffv1-04.txt 2018-09-25 14:15:57.344533994 -0700 +++ 2/draft-ietf-cellar-ffv1-05.txt 2018-09-25 14:15:57.428536053 -0700 @@ -1,20 +1,20 @@ cellar M. Niedermayer Internet-Draft Intended status: Informational D. Rice -Expires: January 28, 2019 +Expires: March 29, 2019 J. Martinez - July 27, 2018 + September 25, 2018 FFV1 Video Coding Format Version 0, 1, and 3 - draft-ietf-cellar-ffv1-04 + draft-ietf-cellar-ffv1-05 Abstract This document defines FFV1, a lossless intra-frame video encoding format. FFV1 is designed to efficiently compress video data in a variety of pixel formats. Compared to uncompressed video, FFV1 offers storage compression, frame fixity, and self-description, which makes FFV1 useful as a preservation or intermediate video format. Status of This Memo @@ -25,66 +25,66 @@ Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet- Drafts is at https://datatracker.ietf.org/drafts/current/. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." - This Internet-Draft will expire on January 28, 2019. + This Internet-Draft will expire on March 29, 2019. Copyright Notice Copyright (c) 2018 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4 2. Notation and Conventions . . . . . . . . . . . . . . . . . . 4 - 2.1. Definitions . . . . . . . . . . . . . . . . . . . . . . . 4 + 2.1. Definitions . . . . . . . . . . . . . . . . . . . . . . . 5 2.2. Conventions . . . . . . . . . . . . . . . . . . . . . . . 5 - 2.2.1. Pseudo-code . . . . . . . . . . . . . . . . . . . . . 5 + 2.2.1. Pseudo-code . . . . . . . . . . . . . . . . . . . . . 6 2.2.2. Arithmetic Operators . . . . . . . . . . . . . . . . 6 2.2.3. Assignment Operators . . . . . . . . . . . . . . . . 6 - 2.2.4. Comparison Operators . . . . . . . . . . . . . . . . 6 + 2.2.4. Comparison Operators . . . . . . . . . . . . . . . . 7 2.2.5. Mathematical Functions . . . . . . . . . . . . . . . 7 - 2.2.6. Order of Operation Precedence . . . . . . . . . . . . 7 + 2.2.6. Order of Operation Precedence . . . . . . . . . . . . 8 2.2.7. Range . . . . . . . . . . . . . . . . . . . . . . . . 8 2.2.8. NumBytes . . . . . . . . . . . . . . . . . . . . . . 8 2.2.9. Bitstream Functions . . . . . . . . . . . . . . . . . 8 3. General Description . . . . . . . . . . . . . . . . . . . . . 9 3.1. Border . . . . . . . . . . . . . . . . . . . . . . . . . 9 - 3.2. Samples . . . . . . . . . . . . . . . . . . . . . . . . . 9 + 3.2. Samples . . . . . . . . . . . . . . . . . . . . . . . . . 10 3.3. Median Predictor . . . . . . . . . . . . . . . . . . . . 10 3.4. Context . . . . . . . . . . . . . . . . . . . . . . . . . 11 3.5. Quantization Table Sets . . . . . . . . . . . . . . . . . 11 3.6. Quantization Table Set Indexes . . . . . . . . . . . . . 11 3.7. Color spaces . . . . . . . . . . . . . . . . . . . . . . 12 3.7.1. YCbCr . . . . . . . . . . . . . . . . . . . . . . . . 12 3.7.2. RGB . . . . . . . . . . . . . . . . . . . . . . . . . 12 3.8. Coding of the Sample Difference . . . . . . . . . . . . . 14 3.8.1. Range Coding Mode . . . . . . . . . . . . . . . . . . 14 3.8.2. Golomb Rice Mode . . . . . . . . . . . . . . . . . . 17 - 4. Bitstream . . . . . . . . . . . . . . . . . . . . . . . . . . 19 + 4. Bitstream . . . . . . . . . . . . . . . . . . . . . . . . . . 20 4.1. Parameters . . . . . . . . . . . . . . . . . . . . . . . 20 4.1.1. version . . . . . . . . . . . . . . . . . . . . . . . 21 4.1.2. micro_version . . . . . . . . . . . . . . . . . . . . 22 4.1.3. coder_type . . . . . . . . . . . . . . . . . . . . . 22 4.1.4. state_transition_delta . . . . . . . . . . . . . . . 23 4.1.5. colorspace_type . . . . . . . . . . . . . . . . . . . 23 4.1.6. chroma_planes . . . . . . . . . . . . . . . . . . . . 23 4.1.7. bits_per_raw_sample . . . . . . . . . . . . . . . . . 23 4.1.8. log2_h_chroma_subsample . . . . . . . . . . . . . . . 24 4.1.9. log2_v_chroma_subsample . . . . . . . . . . . . . . . 24 @@ -157,21 +157,23 @@ distinctions of the versions are provided throughout the document, but in summary: o Version 0 of FFV1 was the original implementation of FFV1 and has been in non-experimental use since April 14, 2006 [FFV1_V0]. o Version 1 of FFV1 adds support of more video bit depths and has been in use since April 24, 2009 [FFV1_V1]. o Version 2 of FFV1 only existed in experimental form and is not - described by this document. + described by this document, but is available as a LyX file at + . o Version 3 of FFV1 adds several features such as increased description of the characteristics of the encoding images and embedded CRC data to support fixity verification of the encoding. Version 3 has been in non-experimental use since August 17, 2013 [FFV1_V3]. The latest version of this document is available at @@ -754,23 +755,24 @@ 226,227,227,229,229,230,231,232,234,234,235,236,237,238,239,240, 241,242,243,244,245,246,247,248,248, 0, 0, 0, 0, 0, 0, 0, 3.8.1.6. Alternative State Transition Table The alternative state transition table has been built using iterative minimization of frame sizes and generally performs better than the default. To use it, the coder_type MUST be set to 2 and the - difference to the default MUST be stored in the parameters. The - reference implementation of FFV1 in FFmpeg uses this table by default - at the time of this writing when Range coding is used. + difference to the default MUST be stored in the "Parameters", see + Section 4.1. The reference implementation of FFV1 in FFmpeg uses + this table by default at the time of this writing when Range coding + is used. 0, 10, 10, 10, 10, 16, 16, 16, 28, 16, 16, 29, 42, 49, 20, 49, 59, 25, 26, 26, 27, 31, 33, 33, 33, 34, 34, 37, 67, 38, 39, 39, 40, 40, 41, 79, 43, 44, 45, 45, 48, 48, 64, 50, 51, 52, 88, 52, 53, 74, 55, 57, 58, 58, 74, 60,101, 61, 62, 84, 66, 66, 68, 69, 87, 82, 71, 97, 73, 73, 82, 75,111, 77, 94, 78, 87, 81, 83, 97, @@ -919,20 +922,25 @@ "frame_pixel_width" is defined as "Frame" width in pixels. "frame_pixel_height" is defined as "Frame" height in pixels. Default values at the decoder initialization phase: "ConfigurationRecordIsPresent" is set to 0. 4.1. Parameters + + The "Parameters" section contains significant characteristics used + for all instances of "Frame". The pseudo-code below describes the + contents of the bitstream. + pseudo-code | type --------------------------------------------------------------|----- Parameters( ) { | version | ur if (version >= 3) | micro_version | ur coder_type | ur if (coder_type > 1) | for (i = 1; i < 256; i++) | state_transition_delta[ i ] | sr @@ -1166,23 +1174,23 @@ | 0 | Frames are independent or dependent (keyframes and non | | | keyframes) | | 1 | Frames are independent (keyframes only) | | Other | reserved for future use | +-------+-----------------------------------------------------------+ 4.2. Configuration Record In the case of a FFV1 bitstream with "version >= 3", a "Configuration Record" is stored in the underlying "Container", at the track header - level. It contains the parameters used for all instances of "Frame". - The size of the "Configuration Record", "NumBytes", is supplied by - the underlying "Container". + level. It contains the "Parameters" used for all instances of + "Frame". The size of the "Configuration Record", "NumBytes", is + supplied by the underlying "Container". pseudo-code | type --------------------------------------------------------------|----- ConfigurationRecord( NumBytes ) { | ConfigurationRecordIsPresent = 1 | Parameters( ) | while( remaining_bits_in_bitstream( NumBytes ) > 32 ) | reserved_for_future_use | u(1) configuration_record_crc_parity | u(32) } | @@ -1249,21 +1257,21 @@ versions 2 or less, the Matroska "CodecPrivate" Element SHOULD NOT be used. For FFV1 versions 3 or greater, the Matroska "CodecPrivate" Element MUST contain the FFV1 "Configuration Record" structure and no other data. See [Matroska] for more information about elements. "NumBytes" is defined as the "Element Data Size" of the "CodecPrivate" Element. 4.3. Frame - A "Frame" consists of the keyframe field, parameters (if version + A "Frame" consists of the keyframe field, "Parameters" (if version <=1), and a sequence of independent slices. pseudo-code | type --------------------------------------------------------------|----- Frame( NumBytes ) { | keyframe | br if (keyframe && !ConfigurationRecordIsPresent | Parameters( ) | while ( remaining_bits_in_bitstream( NumBytes ) ) | Slice( ) | @@ -1757,21 +1765,21 @@ See 11. References 11.1. Normative References [I-D.ietf-cellar-ffv1] Niedermayer, M., Rice, D., and J. Martinez, "FFV1 Video Coding Format Version 0, 1, and 3", draft-ietf-cellar- - ffv1-03 (work in progress), June 2018. + ffv1-04 (work in progress), July 2018. [ISO.15444-1.2016] International Organization for Standardization, "Information technology -- JPEG 2000 image coding system: Core coding system", October 2016. [ISO.9899.1990] International Organization for Standardization, "Programming languages - C", ISO Standard 9899, 1990.