Top | ![]() |
![]() |
![]() |
![]() |
struct | SchroFrame |
struct | SchroFrameData |
enum | SchroFrameFormat |
struct | SchroUpsampledFrame |
#define | SCHRO_FRAME_FORMAT_DEPTH_S16 |
#define | SCHRO_FRAME_FORMAT_DEPTH_S32 |
#define | SCHRO_FRAME_FORMAT_DEPTH_U8 |
#define SCHRO_FRAME_DATA_GET_LINE(fd,i) (SCHRO_OFFSET((fd)->data,(fd)->stride*(i)))
#define SCHRO_FRAME_DATA_GET_PIXEL_S16(fd,i,j) ((int16_t *)SCHRO_OFFSET((fd)->data,(fd)->stride*(j)+(i)*sizeof(int16_t)))
#define SCHRO_FRAME_DATA_GET_PIXEL_U8(fd,i,j) ((uint8_t *)SCHRO_OFFSET((fd)->data,(fd)->stride*(j)+(i)))
SchroFrame *
schro_frame_new (void
);
Creates a new SchroFrame object. The created frame is uninitialized and has no data storage associated with it. The caller must fill in the required information.
SchroFrame * schro_frame_new_and_alloc (SchroMemoryDomain *domain
,SchroFrameFormat format
,int width
,int height
);
Creates a new SchroFrame object with the requested size and format.
SchroFrame * schro_frame_new_from_data_AYUV (void *data
,int width
,int height
);
Creates a new SchroFrame object with the requested size using
the data pointed to by data
. The data must be in AYUV format.
The data must remain for the lifetime of the SchroFrame object.
It is recommended to use schro_frame_set_free_callback()
for
notification when the data is no longer needed.
SchroFrame * schro_frame_new_from_data_I420 (void *data
,int width
,int height
);
Creates a new SchroFrame object with the requested size using
the data pointed to by data
. The data must be in I420 format.
The data must remain for the lifetime of the SchroFrame object.
It is recommended to use schro_frame_set_free_callback()
for
notification when the data is no longer needed.
SchroFrame * schro_frame_new_from_data_YUY2 (void *data
,int width
,int height
);
Creates a new SchroFrame object with the requested size using
the data pointed to by data
. The data must be in YUY2 format.
The data must remain for the lifetime of the SchroFrame object.
It is recommended to use schro_frame_set_free_callback()
for
notification when the data is no longer needed.
SchroFrame *
schro_frame_dup (SchroFrame *frame
);
Creates a new SchroFrame object with the same dimensions and format
as frame
, and copies the data from the frame
to the new object.
SchroFrame *
schro_frame_ref (SchroFrame *frame
);
Increases the reference count of frame
.
void
schro_frame_unref (SchroFrame *frame
);
Decreases the reference count of frame
. If the new reference
count is 0, the frame is freed. If a frame free callback was
set, this function is called.
void schro_frame_set_free_callback (SchroFrame *frame
,SchroFrameFreeFunc free_func
,void *priv
);
Sets a function that will be called when the object reference count drops to zero and the object is freed.
SchroFrame * schro_frame_clone (SchroMemoryDomain *domain
,SchroFrame *frame
);
Creates a new SchroFrame object with the same dimensions and format
as frame
. This function leaves the data in the new object
uninitialized.
void schro_frame_data_get_codeblock (SchroFrameData *dest
,SchroFrameData *src
,int x
,int y
,int horiz_codeblocks
,int vert_codeblocks
);
int schro_frame_get_metric (SchroFrame *frame1
,int x1
,int y1
,SchroFrame *frame2
,int x2
,int y2
);
void schro_frame_get_subdata (SchroFrame *frame
,SchroFrameData *fd
,int comp
,int x
,int y
);
void schro_frame_inverse_iwt_transform_cuda (SchroFrame *frame
,SchroFrame *transform_frame
,SchroParams *params
);
SchroFrame * schro_frame_new_from_data_UYVY (void *data
,int width
,int height
);
Creates a new SchroFrame object with the requested size using
the data pointed to by data
. The data must be in UYVY format.
The data must remain for the lifetime of the SchroFrame object.
It is recommended to use schro_frame_set_free_callback()
for
notification when the data is no longer needed.
SchroFrame * schro_frame_new_from_data_YV12 (void *data
,int width
,int height
);
Creates a new SchroFrame object with the requested size using
the data pointed to by data
. The data must be in YV12 format.
The data must remain for the lifetime of the SchroFrame object.
It is recommended to use schro_frame_set_free_callback()
for
notification when the data is no longer needed.
void schro_frame_convert (SchroFrame *dest
,SchroFrame *src
);
Copies data from the source frame to the destination frame, converting formats if necessary. Only a few conversions are supported.
void schro_frame_add (SchroFrame *dest
,SchroFrame *src
);
Adds data from the source frame to the destination frame. The frames must have the same chroma subsampling, and only a few combinations of bit depths are supported.
void schro_frame_subtract (SchroFrame *dest
,SchroFrame *src
);
Subtracts data from the source frame to the destination frame. The frames must have the same chroma subsampling, and only a few combinations of bit depths are supported.
void schro_frame_shift_left (SchroFrame *frame
,int shift
);
Shifts each value in frame
to the left by shift
bits. This
operation happens in-place.
void schro_frame_shift_right (SchroFrame *frame
,int shift
);
Shifts each value in frame
to the right by shift
bits. This
operation happens in-place.
void schro_frame_edge_extend (SchroFrame *frame
,int width
,int height
);
Extends the edges of the subpicture defined from 0,0 to width
,height
to the size of frame
.
void schro_frame_iwt_transform (SchroFrame *frame
,SchroParams *params
);
Performs an in-place integer wavelet transform on frame
. The
frame must have a bit depth of 16.
void schro_frame_mean_squared_error (SchroFrame *a
,SchroFrame *b
,double *mse
);
double
schro_frame_calculate_average_luma (SchroFrame *frame
);
void schro_upsampled_frame_get_block_fast_precN (SchroUpsampledFrame *upframe
,int k
,int x
,int y
,int prec
,SchroFrameData *dest
,SchroFrameData *fd
);
void schro_upsampled_frame_get_block_precN (SchroUpsampledFrame *upframe
,int k
,int x
,int y
,int prec
,SchroFrameData *dest
);
int schro_upsampled_frame_get_pixel_prec0 (SchroUpsampledFrame *upframe
,int k
,int x
,int y
);
int schro_upsampled_frame_get_pixel_prec1 (SchroUpsampledFrame *upframe
,int k
,int x
,int y
);
int schro_upsampled_frame_get_pixel_prec3 (SchroUpsampledFrame *upframe
,int k
,int x
,int y
);
int schro_upsampled_frame_get_pixel_precN (SchroUpsampledFrame *upframe
,int k
,int x
,int y
,int mv_precision
);
struct SchroFrame { int refcount; SchroFrameFreeFunc free; SchroMemoryDomain *domain; void *regions[3]; void *priv; SchroFrameFormat format; int width; int height; SchroFrameData components[3]; int is_virtual; int cached_lines[3][SCHRO_FRAME_CACHE_SIZE]; SchroFrame *virt_frame1; SchroFrame *virt_frame2; void (*render_line) (SchroFrame *frame, void *dest, int component, int i); void *virt_priv; void *virt_priv2; int extension; int cache_offset[3]; int is_upsampled; };
struct SchroFrameData { SchroFrameFormat format; void *data; int stride; int width; int height; int length; int h_shift; int v_shift; };