1430ce5c32361119ed81a62c918be6afbdd053eddhding/*
2430ce5c32361119ed81a62c918be6afbdd053eddhding* Copyright (c) 2011 Intel Corporation. All Rights Reserved.
3430ce5c32361119ed81a62c918be6afbdd053eddhding* Copyright (c) Imagination Technologies Limited, UK
4430ce5c32361119ed81a62c918be6afbdd053eddhding*
5430ce5c32361119ed81a62c918be6afbdd053eddhding* Permission is hereby granted, free of charge, to any person obtaining a
6430ce5c32361119ed81a62c918be6afbdd053eddhding* copy of this software and associated documentation files (the
7430ce5c32361119ed81a62c918be6afbdd053eddhding* "Software"), to deal in the Software without restriction, including
8430ce5c32361119ed81a62c918be6afbdd053eddhding* without limitation the rights to use, copy, modify, merge, publish,
9430ce5c32361119ed81a62c918be6afbdd053eddhding* distribute, sub license, and/or sell copies of the Software, and to
10430ce5c32361119ed81a62c918be6afbdd053eddhding* permit persons to whom the Software is furnished to do so, subject to
11430ce5c32361119ed81a62c918be6afbdd053eddhding* the following conditions:
12430ce5c32361119ed81a62c918be6afbdd053eddhding*
13430ce5c32361119ed81a62c918be6afbdd053eddhding* The above copyright notice and this permission notice (including the
14430ce5c32361119ed81a62c918be6afbdd053eddhding* next paragraph) shall be included in all copies or substantial portions
15430ce5c32361119ed81a62c918be6afbdd053eddhding* of the Software.
16430ce5c32361119ed81a62c918be6afbdd053eddhding*
17430ce5c32361119ed81a62c918be6afbdd053eddhding* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18430ce5c32361119ed81a62c918be6afbdd053eddhding* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19430ce5c32361119ed81a62c918be6afbdd053eddhding* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
20430ce5c32361119ed81a62c918be6afbdd053eddhding* IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
21430ce5c32361119ed81a62c918be6afbdd053eddhding* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22430ce5c32361119ed81a62c918be6afbdd053eddhding* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23430ce5c32361119ed81a62c918be6afbdd053eddhding* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24430ce5c32361119ed81a62c918be6afbdd053eddhding*
25430ce5c32361119ed81a62c918be6afbdd053eddhding*/
26430ce5c32361119ed81a62c918be6afbdd053eddhding#ifndef _TNG_SLOTORDER_H_
27430ce5c32361119ed81a62c918be6afbdd053eddhding#define _TNG_SLOTORDER_H_
28430ce5c32361119ed81a62c918be6afbdd053eddhding
29e26d82700f9514cc175d2b54733ebdeb8824922ehding#include "tng_hostdefs.h"
30e26d82700f9514cc175d2b54733ebdeb8824922ehding
31430ce5c32361119ed81a62c918be6afbdd053eddhding#define SLOT_STAUS_OCCUPIED 1
32430ce5c32361119ed81a62c918be6afbdd053eddhding#define SLOT_STAUS_EMPTY 0
33e26d82700f9514cc175d2b54733ebdeb8824922ehding
34e26d82700f9514cc175d2b54733ebdeb8824922ehding//#define FRAME_I 0
35e26d82700f9514cc175d2b54733ebdeb8824922ehding//#define FRAME_P 1
36e26d82700f9514cc175d2b54733ebdeb8824922ehding//#define FRAME_B 2
37e26d82700f9514cc175d2b54733ebdeb8824922ehding//#define FRAME_IDR 3
38430ce5c32361119ed81a62c918be6afbdd053eddhding
39430ce5c32361119ed81a62c918be6afbdd053eddhdingtypedef struct _FRAME_ORDER_INFO {
40e26d82700f9514cc175d2b54733ebdeb8824922ehding    unsigned long long max_dpy_num;
41430ce5c32361119ed81a62c918be6afbdd053eddhding    int *slot_consume_dpy_order;
42430ce5c32361119ed81a62c918be6afbdd053eddhding    int *slot_consume_enc_order;
43e26d82700f9514cc175d2b54733ebdeb8824922ehding    IMG_FRAME_TYPE last_frame_type;
44e26d82700f9514cc175d2b54733ebdeb8824922ehding    short last_slot;
45430ce5c32361119ed81a62c918be6afbdd053eddhding} FRAME_ORDER_INFO;
46430ce5c32361119ed81a62c918be6afbdd053eddhding
47430ce5c32361119ed81a62c918be6afbdd053eddhding/* Input, the encoding order, start from 0
48430ce5c32361119ed81a62c918be6afbdd053eddhding * Input, The number of B frames between P and I
49430ce5c32361119ed81a62c918be6afbdd053eddhding * Input, Intra period
50430ce5c32361119ed81a62c918be6afbdd053eddhding * Input & Output. Reset to 0 on first call
51430ce5c32361119ed81a62c918be6afbdd053eddhding * Output. The displaying order
52430ce5c32361119ed81a62c918be6afbdd053eddhding * Output. Frame type. 1: I frame. 2: P frame. 3: B frame
53430ce5c32361119ed81a62c918be6afbdd053eddhding * Output. The corresponding slot index
54430ce5c32361119ed81a62c918be6afbdd053eddhding */
55430ce5c32361119ed81a62c918be6afbdd053eddhding
56430ce5c32361119ed81a62c918be6afbdd053eddhdingint getFrameDpyOrder(
57430ce5c32361119ed81a62c918be6afbdd053eddhding    unsigned long long encoding_count, /*Input, the encoding order, start from 0*/
58430ce5c32361119ed81a62c918be6afbdd053eddhding    int bframes, /*Input, The number of B frames between P and I */
59430ce5c32361119ed81a62c918be6afbdd053eddhding    int intracnt, /*Input, Intra period*/
60430ce5c32361119ed81a62c918be6afbdd053eddhding    int idrcnt, /*INput, IDR period. 0: only one IDR; */
61430ce5c32361119ed81a62c918be6afbdd053eddhding    FRAME_ORDER_INFO *p_last_info, /*Input & Output. Reset to 0 on first call*/
62e26d82700f9514cc175d2b54733ebdeb8824922ehding    unsigned long long *displaying_order); /* Output. The displaying order */
63e26d82700f9514cc175d2b54733ebdeb8824922ehding#endif  //_TNG_SLOTORDER_H_
64