#include <stdint.h>
#include <stdbool.h>
#include <stdlib.h>
Go to the source code of this file.
|
void | uninit (MotionEstContext *ctx) |
|
bool | init_context (MotionEstContext *ctx) |
| Init & allocate context ctx accordingly to the method used. More...
|
|
bool | motion_estimation (MotionEstContext *ctx, uint8_t *img_prev, uint8_t *img_cur) |
| motion estimation wrapper More...
|
|
uint64_t | me_comp_sad (MotionEstContext *me_ctx, int x_mb, int y_mb, int x_mv, int y_mv) |
| omputes the Sum of Absolute Difference (SAD) for the given two blocks More...
|
|
uint8_t * | motionComp (const uint8_t *imgI, const MotionVector16_t *motionVect, size_t w, size_t h, size_t mbSize) |
| Compute motion compensated image's PSNR
. More...
|
|
|
bool | LK_optical_flow (MotionEstContext *) |
| Implement LK optical flow source from wiki and matlab : https://en.wikipedia.org/wiki/Lucas%E2%80%93Kanade_method
. More...
|
|
bool | LK_optical_flow8 (const uint8_t *src1, const uint8_t *src2, uint8_t *v, int w, int h) |
| Lucas Kanade optical 8 bit version. More...
|
|
bool | motionEstARPS (MotionEstContext *) |
| Perform Adaptive Rood Pattern Search algorithm. More...
|
|
bool | motionEstEPZS (MotionEstContext *) |
| Enhance Predictive Zonal Search block matching algo. More...
|
|
◆ BLOCK_MATCHING_ARPS
#define BLOCK_MATCHING_ARPS 2 |
◆ BLOCK_MATCHING_EPZS
#define BLOCK_MATCHING_EPZS 3 |
◆ LK_OPTICAL_FLOW
#define LK_OPTICAL_FLOW 1 |
◆ LK_OPTICAL_FLOW_8BIT
#define LK_OPTICAL_FLOW_8BIT 0 |
◆ mmax
Value: ({ __typeof__ (a) _a = (a); \
__typeof__ (b) _b = (b); \
_a > _b ? _a : _b; })
return max as the same type of input
◆ mmin
Value: ({ __typeof__ (a) _a = (a); \
__typeof__ (b) _b = (b); \
_a < _b ? _a : _b; })
return min as the same type of input
◆ WINDOW
convolution window size for lucas kanade
◆ MotionEstContext
◆ MotionEstPredictor
◆ init_context()
Init & allocate context ctx accordingly to the method used.
- Parameters
-
ctx | : motion estimation context object |
- Returns
- big if true
◆ me_comp_sad()
uint64_t me_comp_sad |
( |
MotionEstContext * |
me_ctx, |
|
|
int |
x_mb, |
|
|
int |
y_mb, |
|
|
int |
x_mv, |
|
|
int |
y_mv |
|
) |
| |
omputes the Sum of Absolute Difference (SAD) for the given two blocks
SAD = \sum_{i=0}^{mbSize}\sum_{j=0}^{mbSize} |Cur_{ij}-Ref_{ij}|
Used as cost function for EPZS algorithm.
- Todo:
- Change ARPS algo such as it uses this function instead of its own
- Parameters
-
me_ctx | |
x_mb | curr frame x located MB (MacroBlock) |
y_mb | curr frame y located MB |
x_mv | prev frame x located MB |
y_mv | prev frame y located MB |
- Returns
- uint64_t
◆ motion_estimation()
motion estimation wrapper
- Will update ctx->name representation of the motion estimation algo used.
- Will call motion estimation algo accordingly (motionEstARPS, motionEstEPZS, LK...)
- current Motion Vector will be saved in mv_table[0].
Example usage :
{
.width = w, .height = h
};
printf("error");
return &me_ctx;
}
- Note
- Some algo will save previous motion into mv_table[1] and mv_table[2]
- Parameters
-
- Returns
- Big if True
◆ uninit()
Exhaustive struct representing all parameter needed for all motion estimation type.
Definition: motion.h:77
bool motion_estimation(MotionEstContext *ctx, uint8_t *img_prev, uint8_t *img_cur)
motion estimation wrapper
Definition: motion.c:137