| 1 |
/* |
| 2 |
* Copyright (c) 2018-2025, Intel Corporation |
| 3 |
* |
| 4 |
* Permission is hereby granted, free of charge, to any person obtaining a |
| 5 |
* copy of this software and associated documentation files (the "Software"), |
| 6 |
* to deal in the Software without restriction, including without limitation |
| 7 |
* the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 8 |
* and/or sell copies of the Software, and to permit persons to whom the |
| 9 |
* Software is furnished to do so, subject to the following conditions: |
| 10 |
* |
| 11 |
* The above copyright notice and this permission notice shall be included |
| 12 |
* in all copies or substantial portions of the Software. |
| 13 |
* |
| 14 |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
| 15 |
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 16 |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 17 |
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR |
| 18 |
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
| 19 |
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
| 20 |
* OTHER DEALINGS IN THE SOFTWARE. |
| 21 |
*/ |
| 22 |
|
| 23 |
//! |
| 24 |
//! \file media_scalability_defs.h |
| 25 |
//! \brief Defines the structures for media scalability |
| 26 |
|
| 27 |
#ifndef __MEDIA_SCALABILITY_DEFS_H__ |
| 28 |
#define __MEDIA_SCALABILITY_DEFS_H__ |
| 29 |
|
| 30 |
#include "mos_util_debug.h" |
| 31 |
#include "mos_os.h" |
| 32 |
|
| 33 |
#define SCALABILITY_CHK_NULL_RETURN(_ptr) \ |
| 34 |
MOS_CHK_NULL_RETURN(MOS_COMPONENT_SCALABILITY, 0, _ptr) |
| 35 |
|
| 36 |
#define SCALABILITY_CHK_STATUS_RETURN(_stmt) \ |
| 37 |
MOS_CHK_STATUS_RETURN(MOS_COMPONENT_SCALABILITY, 0, _stmt) |
| 38 |
|
| 39 |
#define SCALABILITY_CHK_STATUS_MESSAGE_RETURN(_stmt, _message, ...) \ |
| 40 |
MOS_CHK_STATUS_MESSAGE_RETURN(MOS_COMPONENT_SCALABILITY, 0, _stmt, _message, ##__VA_ARGS__) |
| 41 |
|
| 42 |
#define SCALABILITY_ASSERTMESSAGE(_message, ...) \ |
| 43 |
MOS_ASSERTMESSAGE(MOS_COMPONENT_SCALABILITY, 0, _message, ##__VA_ARGS__) |
| 44 |
|
| 45 |
#define SCALABILITY_WARNINGMESSAGE(_message, ...) \ |
| 46 |
MOS_WARNINGMESSAGE(MOS_COMPONENT_SCALABILITY, 0, _message, ##__VA_ARGS__) |
| 47 |
|
| 48 |
#define SCALABILITY_NORMALMESSAGE(_message, ...) \ |
| 49 |
MOS_NORMALMESSAGE(MOS_COMPONENT_SCALABILITY, 0, _message, ##__VA_ARGS__) |
| 50 |
|
| 51 |
#define SCALABILITY_VERBOSEMESSAGE(_message, ...) \ |
| 52 |
MOS_VERBOSEMESSAGE(MOS_COMPONENT_SCALABILITY, 0, _message, ##__VA_ARGS__) |
| 53 |
|
| 54 |
#define SCALABILITY_ASSERT(_expr) \ |
| 55 |
MOS_ASSERT(MOS_COMPONENT_SCALABILITY, 0, _expr) |
| 56 |
|
| 57 |
#define SCALABILITY_COND_CHECK(_expr, _message, ...) \ |
| 58 |
MOS_CHK_COND_RETURN(MOS_COMPONENT_SCALABILITY, 0, _expr, _message, ##__VA_ARGS__) |
| 59 |
|
| 60 |
enum ScalabilityComponentType |
| 61 |
{ |
| 62 |
scalabilityEncoder = 0, |
| 63 |
scalabilityDecoder = 1, |
| 64 |
scalabilityVp = 2, |
| 65 |
scalabilityTotal, |
| 66 |
}; |
| 67 |
enum ScalabilitySyncType |
| 68 |
{ |
| 69 |
syncAllPipes = 0, |
| 70 |
syncOnePipeWaitOthers = 1, |
| 71 |
syncOnePipeForAnother = 2, |
| 72 |
syncOtherPipesForOne = 3, |
| 73 |
}; |
| 74 |
|
| 75 |
struct ScalabilityPars : public ContextRequirement |
| 76 |
{ |
| 77 |
bool enableVE = false; |
| 78 |
bool forceMultiPipe = false; |
| 79 |
|
| 80 |
uint32_t frameWidth = 0; |
| 81 |
uint32_t frameHeight = 0; |
| 82 |
|
| 83 |
uint8_t numVdbox = 0; |
| 84 |
uint16_t numTileRows = 0; |
| 85 |
uint16_t numTileColumns = 0; |
| 86 |
|
| 87 |
uint8_t numVebox = 0; |
| 88 |
bool enableTileReplay = false; |
| 89 |
uint32_t raMode = 0; |
| 90 |
uint32_t protectMode = 0; |
| 91 |
bool allowSwArbitarySplit = false; |
| 92 |
}; |
| 93 |
|
| 94 |
class ScalabilityTrace |
| 95 |
{ |
| 96 |
public: |
| 97 |
ScalabilityTrace(const char *name) : m_name(name) |
| 98 |
{ |
| 99 |
SCALABILITY_VERBOSEMESSAGE("Enter function:%s\r\n", name); |
| 100 |
} |
| 101 |
|
| 102 |
~ScalabilityTrace() |
| 103 |
{ |
| 104 |
SCALABILITY_VERBOSEMESSAGE("Exit function:%s\r\n", m_name); |
| 105 |
} |
| 106 |
|
| 107 |
protected: |
| 108 |
const char *m_name; |
| 109 |
}; |
| 110 |
|
| 111 |
#define SCALABILITY_FUNCTION_ENTER ScalabilityTrace _trace(__FUNCTION__); |
| 112 |
|
| 113 |
struct ComponentState |
| 114 |
{ |
| 115 |
}; |
| 116 |
|
| 117 |
class MediaStatusReport; |
| 118 |
struct StateParams |
| 119 |
{ |
| 120 |
uint8_t currentPipe = 0; |
| 121 |
uint16_t currentPass = 0; |
| 122 |
uint8_t currentRow = 0; |
| 123 |
uint8_t currentSubPass = 0; |
| 124 |
uint8_t pipeIndexForSubmit = 0; |
| 125 |
bool singleTaskPhaseSupported = false; |
| 126 |
MediaStatusReport *statusReport = nullptr; |
| 127 |
ComponentState *componentState = nullptr; |
| 128 |
}; |
| 129 |
|
| 130 |
#endif // !__MEDIA_SCALABILITY_H__ |