Add ssse3 aom_smooth_v_predictor_16,32,64xh
[aom.git] / webmdec.h
blob329908eebf4e9dcb617594b345425dcc30273d7b
1 /*
2 * Copyright (c) 2016, Alliance for Open Media. All rights reserved
4 * This source code is subject to the terms of the BSD 2 Clause License and
5 * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
6 * was not distributed with this source code in the LICENSE file, you can
7 * obtain it at www.aomedia.org/license/software. If the Alliance for Open
8 * Media Patent License 1.0 was not distributed with this source code in the
9 * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
11 #ifndef WEBMDEC_H_
12 #define WEBMDEC_H_
14 #include "./tools_common.h"
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
20 struct AvxInputContext;
22 struct WebmInputContext {
23 void *reader;
24 void *segment;
25 uint8_t *buffer;
26 const void *cluster;
27 const void *block_entry;
28 const void *block;
29 int block_frame_index;
30 int video_track_index;
31 uint64_t timestamp_ns;
32 int is_key_frame;
33 int reached_eos;
36 // Checks if the input is a WebM file. If so, initializes WebMInputContext so
37 // that webm_read_frame can be called to retrieve a video frame.
38 // Returns 1 on success and 0 on failure or input is not WebM file.
39 // TODO(vigneshv): Refactor this function into two smaller functions specific
40 // to their task.
41 int file_is_webm(struct WebmInputContext *webm_ctx,
42 struct AvxInputContext *aom_ctx);
44 // Reads a WebM Video Frame. Memory for the buffer is created, owned and managed
45 // by this function. For the first call, |buffer| should be NULL and
46 // |*buffer_size| should be 0. Once all the frames are read and used,
47 // webm_free() should be called, otherwise there will be a leak.
48 // Parameters:
49 // webm_ctx - WebmInputContext object
50 // buffer - pointer where the frame data will be filled.
51 // buffer_size - pointer to buffer size.
52 // Return values:
53 // 0 - Success
54 // 1 - End of Stream
55 // -1 - Error
56 int webm_read_frame(struct WebmInputContext *webm_ctx, uint8_t **buffer,
57 size_t *buffer_size);
59 // Guesses the frame rate of the input file based on the container timestamps.
60 int webm_guess_framerate(struct WebmInputContext *webm_ctx,
61 struct AvxInputContext *aom_ctx);
63 // Resets the WebMInputContext.
64 void webm_free(struct WebmInputContext *webm_ctx);
66 #ifdef __cplusplus
67 } // extern "C"
68 #endif
70 #endif // WEBMDEC_H_