/* * Copyright (c) 2016, Alliance for Open Media. All rights reserved. * * This source code is subject to the terms of the BSD 2 Clause License and * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License * was not distributed with this source code in the LICENSE file, you can * obtain it at www.aomedia.org/license/software. If the Alliance for Open * Media Patent License 1.0 was not distributed with this source code in the * PATENTS file, you can obtain it at www.aomedia.org/license/patent. */ /*!\file * \brief This file has the implementation details of the grain table. * * The file format is an ascii representation for readability and * editability. Array parameters are separated from the non-array * parameters and prefixed with a few characters to make for easy * localization with a parameter set. Each entry is prefixed with "E" * and the other parameters are only specified if "update-parms" is * non-zero. * * filmgrn1 * E <start-time> <end-time> <apply-grain> <random-seed> <update-parms> * p <ar_coeff_lag> <ar_coeff_shift> <grain_scale_shift> ... * sY <num_y_points> <point_0_x> <point_0_y> ... * sCb <num_cb_points> <point_0_x> <point_0_y> ... * sCr <num_cr_points> <point_0_x> <point_0_y> ... * cY <ar_coeff_y_0> .... * cCb <ar_coeff_cb_0> .... * cCr <ar_coeff_cr_0> .... * E <start-time> ... */ #include <string.h> #include <stdio.h> #include "aom_dsp/aom_dsp_common.h" #include "aom_dsp/grain_table.h" #include "aom_mem/aom_mem.h" static const char kFileMagic[8] = …; static void grain_table_entry_read(FILE *file, struct aom_internal_error_info *error_info, aom_film_grain_table_entry_t *entry) { … } static void grain_table_entry_write(FILE *file, aom_film_grain_table_entry_t *entry) { … } // TODO(https://crbug.com/aomedia/3228): Update this function to return an // integer status. void aom_film_grain_table_append(aom_film_grain_table_t *t, int64_t time_stamp, int64_t end_time, const aom_film_grain_t *grain) { … } int aom_film_grain_table_lookup(aom_film_grain_table_t *t, int64_t time_stamp, int64_t end_time, int erase, aom_film_grain_t *grain) { … } aom_codec_err_t aom_film_grain_table_read( aom_film_grain_table_t *t, const char *filename, struct aom_internal_error_info *error_info) { … } aom_codec_err_t aom_film_grain_table_write( const aom_film_grain_table_t *t, const char *filename, struct aom_internal_error_info *error_info) { … } void aom_film_grain_table_free(aom_film_grain_table_t *t) { … }