schro-stdint.h   schro-stdint.h 
#ifndef _SCHROEDINGER_SCHROEDINGER_SCHRO_STDINT_H #include <schroedinger/schroutils.h>
#define _SCHROEDINGER_SCHROEDINGER_SCHRO_STDINT_H 1
#ifndef _GENERATED_STDINT_H
#define _GENERATED_STDINT_H "schroedinger 1.0.5"
/* generated using gnu compiler gcc (SUSE Linux) 4.4.1 [gcc-4_4-branch revi
sion 150839] */
#define _STDINT_HAVE_STDINT_H 1
#include <stdint.h>
#endif
#endif
 End of changes. 1 change blocks. 
lines changed or deleted lines changed or added


 schro.h   schro.h 
skipping to change at line 22 skipping to change at line 22
#include <schroedinger/schrodomain.h> #include <schroedinger/schrodomain.h>
#include <schroedinger/schroencoder.h> #include <schroedinger/schroencoder.h>
#include <schroedinger/schroengine.h> #include <schroedinger/schroengine.h>
#include <schroedinger/schrofilter.h> #include <schroedinger/schrofilter.h>
#include <schroedinger/schroframe.h> #include <schroedinger/schroframe.h>
#include <schroedinger/schrolimits.h> #include <schroedinger/schrolimits.h>
#include <schroedinger/schromotion.h> #include <schroedinger/schromotion.h>
#include <schroedinger/schromotionest.h> #include <schroedinger/schromotionest.h>
#include <schroedinger/schropack.h> #include <schroedinger/schropack.h>
#include <schroedinger/schroparams.h> #include <schroedinger/schroparams.h>
#include <schroedinger/schrophasecorrelation.h>
#include <schroedinger/schroqueue.h> #include <schroedinger/schroqueue.h>
#include <schroedinger/schrossim.h> #include <schroedinger/schrossim.h>
#include <schroedinger/schrotables.h> #include <schroedinger/schrotables.h>
#include <schroedinger/schrowavelet.h> #include <schroedinger/schrowavelet.h>
#include <schroedinger/schrometric.h> #include <schroedinger/schrometric.h>
#include <schroedinger/schroutils.h> #include <schroedinger/schroutils.h>
#include <schroedinger/schroversion.h>
SCHRO_BEGIN_DECLS SCHRO_BEGIN_DECLS
void schro_init(void); void schro_init(void);
SCHRO_END_DECLS SCHRO_END_DECLS
#endif #endif
 End of changes. 2 change blocks. 
0 lines changed or deleted 2 lines changed or added


 schroanalysis.h   schroanalysis.h 
skipping to change at line 13 skipping to change at line 13
#define __SCHRO_ANALYSIS_H__ #define __SCHRO_ANALYSIS_H__
#include <schroedinger/schroencoder.h> #include <schroedinger/schroencoder.h>
SCHRO_BEGIN_DECLS SCHRO_BEGIN_DECLS
#ifdef SCHRO_ENABLE_UNSTABLE_API #ifdef SCHRO_ENABLE_UNSTABLE_API
void schro_encoder_frame_analyse (SchroEncoderFrame *frame); void schro_encoder_frame_analyse (SchroEncoderFrame *frame);
void schro_encoder_frame_downsample (SchroEncoderFrame *frame); void schro_encoder_frame_downsample (SchroEncoderFrame *frame);
void schro_encoder_frame_upsample (SchroEncoderFrame* frame);
void schro_frame_mean_squared_error (SchroFrame *a, SchroFrame *b, double * mse); void schro_frame_mean_squared_error (SchroFrame *a, SchroFrame *b, double * mse);
#endif #endif
SCHRO_END_DECLS SCHRO_END_DECLS
#endif #endif
 End of changes. 1 change blocks. 
0 lines changed or deleted 1 lines changed or added


 schroarith.h   schroarith.h 
skipping to change at line 90 skipping to change at line 90
SCHRO_CTX_MV_REF2_V_VALUE, SCHRO_CTX_MV_REF2_V_VALUE,
SCHRO_CTX_MV_REF2_V_SIGN, SCHRO_CTX_MV_REF2_V_SIGN,
SCHRO_CTX_LAST SCHRO_CTX_LAST
}; };
typedef struct _SchroArith SchroArith; typedef struct _SchroArith SchroArith;
typedef struct _SchroArithContext SchroArithContext; typedef struct _SchroArithContext SchroArithContext;
struct _SchroArithContext { struct _SchroArithContext {
int next; unsigned int next;
int stat_range; int stat_range;
int n_bits; int n_bits;
int n_symbols; int n_symbols;
int ones; int ones;
}; };
struct _SchroArith { struct _SchroArith {
SchroBuffer *buffer;
uint8_t *dataptr;
uintptr_t offset;
uint32_t range[2]; uint32_t range[2];
uint32_t code; uint32_t code;
uint32_t range_size; uint32_t range_size;
uint16_t probabilities[SCHRO_CTX_LAST];
uint8_t shift;
uint16_t lut[512];
int cntr; int cntr;
uint8_t *dataptr;
int offset;
int carry; int carry;
SchroArithContext contexts[SCHRO_CTX_LAST];
SchroBuffer *buffer; uint16_t probabilities[SCHRO_CTX_LAST];
uint16_t lut[512];
SchroArithContext contexts[SCHRO_CTX_LAST];
}; };
SchroArith * schro_arith_new (void); SchroArith * schro_arith_new (void);
void schro_arith_free (SchroArith *arith); void schro_arith_free (SchroArith *arith);
void schro_arith_decode_init (SchroArith *arith, SchroBuffer *buffer); void schro_arith_decode_init (SchroArith *arith, SchroBuffer *buffer);
void schro_arith_encode_init (SchroArith *arith, SchroBuffer *buffer); void schro_arith_encode_init (SchroArith *arith, SchroBuffer *buffer);
void schro_arith_estimate_init (SchroArith *arith); void schro_arith_estimate_init (SchroArith *arith);
void schro_arith_flush (SchroArith *arith); void schro_arith_flush (SchroArith *arith);
void schro_arith_decode_flush (SchroArith *arith); void schro_arith_decode_flush (SchroArith *arith);
void schro_arith_encode_bit (SchroArith *arith, int context, int value); void schro_arith_encode_bit (SchroArith *arith, int context, int value);
void schro_arith_encode_uint (SchroArith *arith, int cont_context, void schro_arith_encode_uint (SchroArith *arith, int cont_context,
int value_context, int value); int value_context, int value);
void schro_arith_encode_sint (SchroArith *arith, int cont_context, void schro_arith_encode_sint (SchroArith *arith, int cont_context,
int value_context, int sign_context, int value); int value_context, int sign_context, int value);
int schro_arith_decode_bit (SchroArith *arith, int context); int schro_arith_decode_bit (SchroArith *arith, unsigned int context);
int schro_arith_decode_uint (SchroArith *arith, int cont_context, int schro_arith_decode_uint (SchroArith *arith, unsigned int cont_context,
int value_context); unsigned int value_context);
int schro_arith_decode_sint (SchroArith *arith, int cont_context, int schro_arith_decode_sint (SchroArith *arith, unsigned int cont_context,
int value_context, int sign_context); unsigned int value_context, unsigned int sign_context);
void _schro_arith_encode_bit (SchroArith *arith, int context, int
value) SCHRO_INTERNAL;
void _schro_arith_encode_uint (SchroArith *arith, int cont_context,
int value_context, int value) SCHRO_INTERNAL;
void _schro_arith_encode_sint (SchroArith *arith, int cont_context,
int value_context, int sign_context, int value) SCHRO_INTERNAL;
int _schro_arith_decode_sint (SchroArith *arith, int cont_context, int _schro_arith_decode_sint (SchroArith *arith, unsigned int cont_context,
int value_context, int sign_context) SCHRO_INTERNAL; unsigned int value_context, unsigned int sign_context) SCHRO_INTERNAL;
void schro_arith_estimate_bit (SchroArith *arith, int i, int value); void schro_arith_estimate_bit (SchroArith *arith, int i, int value);
void schro_arith_estimate_uint (SchroArith *arith, int cont_context, void schro_arith_estimate_uint (SchroArith *arith, int cont_context,
int value_context, int value); int value_context, int value);
void schro_arith_estimate_sint (SchroArith *arith, int cont_context, void schro_arith_estimate_sint (SchroArith *arith, int cont_context,
int value_context, int sign_context, int value); int value_context, int sign_context, int value);
#ifdef SCHRO_ARITH_DEFINE_INLINE #ifdef SCHRO_ARITH_DEFINE_INLINE
static int static inline int
_schro_arith_decode_bit (SchroArith *arith, int i) _schro_arith_decode_bit (SchroArith *arith, unsigned int i)
{ {
unsigned int range_x_prob; unsigned int range_x_prob;
int value; unsigned int value;
int lut_index; unsigned int lut_index;
register unsigned int range = arith->range[1];
register unsigned int code_minus_low = arith->code;
range_x_prob = (arith->range[1] * arith->probabilities[i]) >> 16; while (range <= 0x40000000) {
lut_index = arith->probabilities[i]>>8;
range <<= 1;
code_minus_low <<= 1;
if (!--arith->cntr) {
arith->offset++;
if (arith->offset < arith->buffer->length) {
code_minus_low |= arith->dataptr[arith->offset] << 8;
} else {
code_minus_low |= 0xff00;
}
arith->offset++;
if (arith->offset < arith->buffer->length) {
code_minus_low |= arith->dataptr[arith->offset];
} else {
code_minus_low |= 0xff;
}
arith->cntr = 16;
}
}
range_x_prob = ((range >> 16) * arith->probabilities[i]) & 0xFFFF0000;
lut_index = arith->probabilities[i]>>7 & ~1;
value = (code_minus_low >= range_x_prob);
arith->probabilities[i] += arith->lut[lut_index | value];
value = (arith->code - arith->range[0] >= range_x_prob);
arith->probabilities[i] += arith->lut[(value<<8) | lut_index];
if (value) { if (value) {
arith->range[0] += range_x_prob; code_minus_low -= range_x_prob;
range -= range_x_prob;
} else {
range = range_x_prob;
}
arith->range[1] = range;
arith->code = code_minus_low;
return value;
}
static inline int
_schro_arith_decode_uint (SchroArith *arith, unsigned int cont_context,
unsigned int value_context)
{
unsigned int bits=1;
while(!_schro_arith_decode_bit (arith, cont_context)) {
bits <<= 1;
bits |= _schro_arith_decode_bit (arith, value_context);
cont_context = arith->contexts[cont_context].next;
}
return bits - 1;
}
static inline void
_schro_arith_encode_bit (SchroArith *arith, int i, int value)
{
unsigned int range;
unsigned int probability0;
unsigned int range_x_prob;
probability0 = arith->probabilities[i];
range = arith->range[1];
range_x_prob = (range * probability0) >> 16;
if (value) {
arith->range[0] = arith->range[0] + range_x_prob;
arith->range[1] -= range_x_prob; arith->range[1] -= range_x_prob;
arith->probabilities[i] -= arith->lut[arith->probabilities[i]>>8];
} else { } else {
arith->range[1] = range_x_prob; arith->range[1] = range_x_prob;
arith->probabilities[i] += arith->lut[255-(arith->probabilities[i]>>8)] ;
} }
while (arith->range[1] <= 0x4000) { while (arith->range[1] <= 0x4000) {
arith->range[0] <<= 1; arith->range[0] <<= 1;
arith->range[1] <<= 1; arith->range[1] <<= 1;
arith->code <<= 1;
arith->code |= arith->shift >> (7-arith->cntr)&1;
arith->cntr++; arith->cntr++;
if (arith->cntr == 8) { if (arith->cntr == 8) {
arith->offset++; if (arith->range[0] < (1<<24) &&
if (arith->offset < arith->buffer->length) { (arith->range[0] + arith->range[1]) >= (1<<24)) {
arith->shift = arith->dataptr[arith->offset]; arith->carry++;
} else { } else {
arith->shift = 0xff; if (arith->range[0] >= (1<<24)) {
arith->dataptr[arith->offset-1]++;
while (arith->carry) {
arith->dataptr[arith->offset] = 0x00;
arith->carry--;
arith->offset++;
}
} else {
while (arith->carry) {
arith->dataptr[arith->offset] = 0xff;
arith->carry--;
arith->offset++;
}
}
arith->dataptr[arith->offset] = arith->range[0] >> 16;
arith->offset++;
} }
arith->range[0] &= 0xffff;
arith->code &= 0xffff;
if (arith->code < arith->range[0]) { arith->range[0] &= 0xffff;
arith->code |= (1<<16);
}
arith->cntr = 0; arith->cntr = 0;
} }
} }
}
return value; static inline int
maxbit (unsigned int x)
{
#if 0
int i;
for(i=0;x;i++){
x >>= 1;
}
return i;
#else
int i = 0;
if (x == 0) return 0;
if (x > 0x00ff) {
i += 8;
x >>= 8;
}
if (x > 0x000f) {
i += 4;
x >>= 4;
}
if (x > 0x0003) {
i += 2;
x >>= 2;
}
if (x > 0x0001) {
i += 1;
x >>= 1;
}
if (x > 0x0000) {
i += 1;
}
return i;
#endif
} }
static int static inline void
_schro_arith_decode_uint (SchroArith *arith, int cont_context, _schro_arith_encode_uint (SchroArith *arith, int cont_context,
int value_context) int value_context, int value)
{ {
int bits; int i;
int count=0; int n_bits;
bits = 0; value++;
while(!_schro_arith_decode_bit (arith, cont_context)) { n_bits = maxbit(value);
bits <<= 1; for(i=0;i<n_bits - 1;i++){
bits |= _schro_arith_decode_bit (arith, value_context); _schro_arith_encode_bit (arith, cont_context, 0);
_schro_arith_encode_bit (arith, value_context,
(value>>(n_bits - 2 - i))&1);
cont_context = arith->contexts[cont_context].next; cont_context = arith->contexts[cont_context].next;
count++; }
_schro_arith_encode_bit (arith, cont_context, 1);
}
/* FIXME being careful */ static inline void
if (count == 30) break; _schro_arith_encode_sint (SchroArith *arith, int cont_context,
int value_context, int sign_context, int value)
{
int sign;
if (value < 0) {
sign = 1;
value = -value;
} else {
sign = 0;
}
_schro_arith_encode_uint (arith, cont_context, value_context, value);
if (value) {
_schro_arith_encode_bit (arith, sign_context, sign);
} }
return (1<<count) - 1 + bits;
} }
#endif
#else /* SCHRO_ARITH_DEFINE_INLINE */
int _schro_arith_decode_bit (SchroArith *arith, unsigned int context);
int _schro_arith_decode_uint (SchroArith *arith, unsigned int cont_context,
unsigned int value_context);
void _schro_arith_encode_bit (SchroArith *arith, int context, int
value) SCHRO_INTERNAL;
void _schro_arith_encode_uint (SchroArith *arith, int cont_context,
int value_context, int value) SCHRO_INTERNAL;
void _schro_arith_encode_sint (SchroArith *arith, int cont_context,
int value_context, int sign_context, int value) SCHRO_INTERNAL;
#endif /* SCHRO_ARITH_DEFINE_INLINE */
#endif #endif
SCHRO_END_DECLS SCHRO_END_DECLS
#endif #endif
 End of changes. 29 change blocks. 
61 lines changed or deleted 187 lines changed or added


 schroasync.h   schroasync.h 
skipping to change at line 15 skipping to change at line 15
#include <schroedinger/schroutils.h> #include <schroedinger/schroutils.h>
#include <schroedinger/schrodomain.h> #include <schroedinger/schrodomain.h>
SCHRO_BEGIN_DECLS SCHRO_BEGIN_DECLS
typedef int SchroExecDomain; typedef int SchroExecDomain;
typedef struct _SchroAsync SchroAsync; typedef struct _SchroAsync SchroAsync;
typedef struct _SchroThread SchroThread; typedef struct _SchroThread SchroThread;
typedef struct _SchroAsyncTask SchroAsyncTask; typedef struct _SchroAsyncTask SchroAsyncTask;
typedef struct _SchroAsyncStage SchroAsyncStage;
typedef struct _SchroMutex SchroMutex; typedef struct _SchroMutex SchroMutex;
#ifdef SCHRO_ENABLE_UNSTABLE_API #ifdef SCHRO_ENABLE_UNSTABLE_API
typedef int (*SchroAsyncScheduleFunc)(void *, SchroExecDomain exec_domain); typedef int (*SchroAsyncScheduleFunc)(void *, SchroExecDomain exec_domain);
typedef void (*SchroAsyncCompleteFunc)(void *); typedef void (*SchroAsyncCompleteFunc)(void *);
typedef void (*SchroAsyncTaskFunc) (void *);
struct _SchroAsyncTask {
SchroAsyncTaskFunc task_func;
void *priv;
};
struct _SchroAsyncStage {
SchroAsyncTaskFunc task_func;
void *priv;
schro_bool is_ready;
schro_bool is_needed; /* FIXME remove eventually */
schro_bool is_done;
int priority;
int n_tasks_started;
int n_tasks_completed;
int n_tasks;
SchroAsyncTaskFunc tasks[10];
};
void schro_async_init (void); void schro_async_init (void);
SchroAsync * schro_async_new(int n_threads, SchroAsync * schro_async_new(int n_threads,
SchroAsyncScheduleFunc schedule, SchroAsyncScheduleFunc schedule,
SchroAsyncCompleteFunc complete, SchroAsyncCompleteFunc complete,
void *closure); void *closure);
void schro_async_free (SchroAsync *async); void schro_async_free (SchroAsync *async);
void schro_async_run_locked (SchroAsync *async, void (*func)(void *), void /**
*ptr); * schro_async_stop:
int schro_async_get_num_completed (SchroAsync *async); *
void schro_async_wait_one (SchroAsync *async); * wait for all worker threads belonging to @async to finish their
* current task. no further tasks will be executed until
* schro_async_start is called
*/
void schro_async_stop (SchroAsync *async);
/**
* schro_async_sart:
*
* Resume execution of scheduler for @async after schro_async_stop
* has been called.
*/
void schro_async_start (SchroAsync *async);
void schro_async_run_stage_locked (SchroAsync *async, SchroAsyncStage *stag
e);
int schro_async_wait_locked (SchroAsync *async); int schro_async_wait_locked (SchroAsync *async);
void schro_async_wait (SchroAsync *async, int min_waiting);
void *schro_async_pull (SchroAsync *async);
void * schro_async_pull_locked (SchroAsync *async);
void schro_async_signal_scheduler (SchroAsync *async); void schro_async_signal_scheduler (SchroAsync *async);
void schro_async_lock (SchroAsync *async); void schro_async_lock (SchroAsync *async);
void schro_async_unlock (SchroAsync *async); void schro_async_unlock (SchroAsync *async);
SchroExecDomain schro_async_get_exec_domain (void); SchroExecDomain schro_async_get_exec_domain (void);
void schro_async_add_cuda (SchroAsync *async); void schro_async_add_exec_domain (SchroAsync *async,
SchroExecDomain exec_domain);
SchroMutex *schro_mutex_new (void); SchroMutex *schro_mutex_new (void);
#if 0
SchroMutex *schro_mutex_new_recursive (void);
#endif
void schro_mutex_lock (SchroMutex *mutex); void schro_mutex_lock (SchroMutex *mutex);
void schro_mutex_unlock (SchroMutex *mutex); void schro_mutex_unlock (SchroMutex *mutex);
void schro_mutex_free (SchroMutex *mutex); void schro_mutex_free (SchroMutex *mutex);
#endif #endif
SCHRO_END_DECLS SCHRO_END_DECLS
#endif #endif
 End of changes. 6 change blocks. 
8 lines changed or deleted 46 lines changed or added


 schrobitstream.h   schrobitstream.h 
skipping to change at line 145 skipping to change at line 145
typedef enum _SchroAuxiliaryDataID { typedef enum _SchroAuxiliaryDataID {
SCHRO_AUX_DATA_INVALID, SCHRO_AUX_DATA_INVALID,
SCHRO_AUX_DATA_ENCODER_STRING, SCHRO_AUX_DATA_ENCODER_STRING,
SCHRO_AUX_DATA_SMPTE_12M_TIMECODE, SCHRO_AUX_DATA_SMPTE_12M_TIMECODE,
SCHRO_AUX_DATA_MD5_CHECKSUM, SCHRO_AUX_DATA_MD5_CHECKSUM,
SCHRO_AUX_DATA_BITRATE, SCHRO_AUX_DATA_BITRATE,
SCHRO_AUX_DATA_USER = 0x80 SCHRO_AUX_DATA_USER = 0x80
}SchroAuxiliaryDataID; }SchroAuxiliaryDataID;
typedef enum _SchroProfile {
SCHRO_PROFILE_LOW_DELAY = 0,
SCHRO_PROFILE_SIMPLE = 1,
SCHRO_PROFILE_MAIN_INTRA = 2,
SCHRO_PROFILE_MAIN = 8
} SchroProfile;
SCHRO_END_DECLS SCHRO_END_DECLS
#endif #endif
 End of changes. 1 change blocks. 
0 lines changed or deleted 7 lines changed or added


 schrobuffer.h   schrobuffer.h 
#ifndef __SCHRO_BUFFER_H__ #ifndef __SCHRO_BUFFER_H__
#define __SCHRO_BUFFER_H__ #define __SCHRO_BUFFER_H__
#include <schroedinger/schroutils.h> #include <schroedinger/schroutils.h>
SCHRO_BEGIN_DECLS SCHRO_BEGIN_DECLS
typedef struct _SchroBuffer SchroBuffer; typedef struct _SchroBuffer SchroBuffer;
typedef struct _SchroTag SchroTag;
struct _SchroBuffer struct _SchroBuffer
{ {
/*< private >*/ /*< private >*/
unsigned char *data; unsigned char *data;
int length; unsigned int length;
int ref_count; int ref_count;
SchroBuffer *parent; SchroBuffer *parent;
void (*free) (SchroBuffer *, void *); void (*free) (SchroBuffer *, void *);
void *priv; void *priv;
SchroTag* tag;
};
struct _SchroTag
{
void (*free) (void *);
void *value;
}; };
SchroBuffer *schro_buffer_new (void); SchroBuffer *schro_buffer_new (void);
SchroBuffer *schro_buffer_new_and_alloc (int size); SchroBuffer *schro_buffer_new_and_alloc (int size);
SchroBuffer *schro_buffer_new_with_data (void *data, int size); SchroBuffer *schro_buffer_new_with_data (void *data, int size);
SchroBuffer *schro_buffer_new_subbuffer (SchroBuffer * buffer, int offset, SchroBuffer *schro_buffer_new_subbuffer (SchroBuffer * buffer, int offset,
int length); int length);
SchroBuffer *schro_buffer_dup (SchroBuffer * buffer); SchroBuffer *schro_buffer_dup (SchroBuffer * buffer);
SchroBuffer * schro_buffer_ref (SchroBuffer * buffer); SchroBuffer * schro_buffer_ref (SchroBuffer * buffer);
void schro_buffer_unref (SchroBuffer * buffer); void schro_buffer_unref (SchroBuffer * buffer);
SchroTag *schro_tag_new (void *value, void (*free_func) (void *));
void schro_tag_free (SchroTag *tag);
SCHRO_END_DECLS SCHRO_END_DECLS
#endif #endif
 End of changes. 4 change blocks. 
1 lines changed or deleted 13 lines changed or added


 schrodecoder.h   schrodecoder.h 
skipping to change at line 14 skipping to change at line 14
#include <schroedinger/schrobuffer.h> #include <schroedinger/schrobuffer.h>
#include <schroedinger/schroparams.h> #include <schroedinger/schroparams.h>
#include <schroedinger/schroframe.h> #include <schroedinger/schroframe.h>
#include <schroedinger/schromotion.h> #include <schroedinger/schromotion.h>
#include <schroedinger/schrounpack.h> #include <schroedinger/schrounpack.h>
#include <schroedinger/schrobitstream.h> #include <schroedinger/schrobitstream.h>
#include <schroedinger/schroqueue.h> #include <schroedinger/schroqueue.h>
#include <schroedinger/schroasync.h> #include <schroedinger/schroasync.h>
#include <schroedinger/schroarith.h> #include <schroedinger/schroarith.h>
#include <schroedinger/schrobufferlist.h>
#include <schroedinger/schroparse.h>
SCHRO_BEGIN_DECLS SCHRO_BEGIN_DECLS
typedef struct _SchroDecoder SchroDecoder; typedef struct _SchroDecoder SchroDecoder;
typedef struct _SchroDecoderInstance SchroDecoderInstance;
typedef struct _SchroPicture SchroPicture; typedef struct _SchroPicture SchroPicture;
#ifdef SCHRO_ENABLE_UNSTABLE_API #ifdef SCHRO_ENABLE_UNSTABLE_API
struct _SchroDecoder {
/*< private >*/
/* the list of reference pictures */ #ifndef SCHRO_OPENGL_TYPEDEF
SchroQueue *reference_queue; #define SCHRO_OPENGL_TYPEDEF
typedef struct _SchroOpenGL SchroOpenGL;
#endif
/* a list of frames provided by the app that we'll decode into */ struct _SchroDecoder {
SchroQueue *output_queue; /*< private >*/
SchroMemoryDomain *cpu_domain; SchroMemoryDomain *cpu_domain;
SchroMemoryDomain *cuda_domain; SchroMemoryDomain *cuda_domain;
SchroMemoryDomain *opengl_domain;
SchroAsync *async; SchroAsync *async;
int use_cuda; int use_cuda;
SchroOpenGL *opengl;
int use_opengl;
SchroBuffer *input_buffer; double skip_value;
double skip_ratio;
int earliest_frame;
SchroPictureNumber next_frame_number; /* output pictures in coded order */
int coded_order;
SchroPicture *picture; int error;
char *error_message;
SchroBufferList *input_buflist;
SchroParseSyncState *sps;
/* private data that is supplied with the input bitstream and
* is to be associated with the next picture to occur */
SchroTag *next_picture_tag;
SchroDecoderInstance *instance;
};
struct _SchroDecoderInstance {
/*< private >*/
/* the decoder this sequence instance belongs to */
SchroDecoder *decoder;
/* the next sequence instance to supercede this
* - New instances should be created whenever an EOS
* is detected at the input to the decoder
* - Old instances should be deleted whenever their
* state would cause an EOS to be emitted */
SchroDecoderInstance *next;
/* the list of reference pictures */
SchroQueue *reference_queue;
/* a list of frames provided by the app that we'll decode into */
/* xxx: maybe this belongs in Decoder and not per instance */
SchroQueue *output_queue;
/* the last picture number to be emitted by decoder_pull().
* used to determine if a stream jumps backwards */
SchroPictureNumber last_picture_number;
int last_picture_number_valid;
int major_version; int major_version;
int minor_version; int minor_version;
int profile; int profile;
int level; int level;
SchroVideoFormat video_format; SchroVideoFormat video_format;
int compat_quant_offset;
SchroQueue *frame_queue; SchroQueue *reorder_queue;
SchroQueue *picture_queue; int reorder_queue_size;
int queue_depth;
int end_of_stream; int end_of_stream;
int flushing; int flushing;
int coded_order;
SchroPictureNumber earliest_frame;
SchroUnpack unpack;
int parse_code;
int next_parse_offset;
int prev_parse_offset;
int first_sequence_header;
int have_sequence_header; int have_sequence_header;
SchroBuffer *sequence_header_buffer; SchroBuffer *sequence_header_buffer;
int have_frame_number; int have_frame_number;
double skip_value;
double skip_ratio;
int error;
char *error_message;
int has_md5; int has_md5;
uint8_t md5_checksum[32]; uint8_t md5_checksum[32];
}; };
struct _SchroPicture { struct _SchroPicture {
int refcount; int refcount;
SchroDecoder *decoder; SchroDecoderInstance *decoder_instance;
unsigned int state;
unsigned int needed_state;
unsigned int working;
int busy; int busy;
int skip; int skip;
int error; int error;
SchroBuffer *input_buffer; SchroBuffer *input_buffer;
SchroParams params; SchroParams params;
SchroPictureNumber picture_number; SchroPictureNumber picture_number;
SchroPictureNumber reference1; SchroPictureNumber reference1;
SchroPictureNumber reference2; SchroPictureNumber reference2;
SchroPictureNumber retired_picture_number; SchroPictureNumber retired_picture_number;
SchroPicture *ref0; SchroPicture *ref0;
SchroPicture *ref1; SchroPicture *ref1;
SchroFrame *planar_output_frame; SchroFrame *planar_output_frame;
int is_ref; SchroAsyncStage stages[9];
int16_t *tmpbuf; int is_ref;
int zero_residual; int zero_residual;
SchroFrame *transform_frame; SchroFrame *transform_frame;
SchroFrame *frame; SchroFrame *frame;
SchroFrame *mc_tmp_frame; SchroFrame *mc_tmp_frame;
SchroMotion *motion; SchroMotion *motion;
SchroFrame *output_picture; SchroFrame *output_picture;
SchroUpsampledFrame *upsampled_frame; SchroUpsampledFrame *upsampled_frame;
skipping to change at line 122 skipping to change at line 153
int subband_quant_index[3][SCHRO_LIMIT_SUBBANDS]; int subband_quant_index[3][SCHRO_LIMIT_SUBBANDS];
SchroBuffer *subband_buffer[3][SCHRO_LIMIT_SUBBANDS]; SchroBuffer *subband_buffer[3][SCHRO_LIMIT_SUBBANDS];
SchroFrameData subband_data[3][SCHRO_LIMIT_SUBBANDS]; SchroFrameData subband_data[3][SCHRO_LIMIT_SUBBANDS];
SchroBuffer *motion_buffers[9]; SchroBuffer *motion_buffers[9];
SchroBuffer *lowdelay_buffer; SchroBuffer *lowdelay_buffer;
int has_md5; int has_md5;
uint8_t md5_checksum[32]; uint8_t md5_checksum[32];
/* private data that is associated with this picture */
SchroTag *tag;
}; };
#endif #endif
enum { enum {
SCHRO_DECODER_OK, SCHRO_DECODER_OK,
SCHRO_DECODER_ERROR, SCHRO_DECODER_ERROR,
SCHRO_DECODER_EOS, SCHRO_DECODER_EOS,
SCHRO_DECODER_FIRST_ACCESS_UNIT, SCHRO_DECODER_FIRST_ACCESS_UNIT,
SCHRO_DECODER_NEED_BITS, SCHRO_DECODER_NEED_BITS,
SCHRO_DECODER_NEED_FRAME, SCHRO_DECODER_NEED_FRAME,
SCHRO_DECODER_WAIT, SCHRO_DECODER_WAIT,
skipping to change at line 148 skipping to change at line 183
SCHRO_DECODER_PICTURE_ORDER_CODED SCHRO_DECODER_PICTURE_ORDER_CODED
}; };
SchroDecoder * schro_decoder_new (void); SchroDecoder * schro_decoder_new (void);
void schro_decoder_free (SchroDecoder *decoder); void schro_decoder_free (SchroDecoder *decoder);
void schro_decoder_reset (SchroDecoder *decoder); void schro_decoder_reset (SchroDecoder *decoder);
SchroVideoFormat * schro_decoder_get_video_format (SchroDecoder *decoder); SchroVideoFormat * schro_decoder_get_video_format (SchroDecoder *decoder);
void schro_decoder_add_output_picture (SchroDecoder *decoder, SchroFrame *f rame); void schro_decoder_add_output_picture (SchroDecoder *decoder, SchroFrame *f rame);
int schro_decoder_push_ready (SchroDecoder *decoder); int schro_decoder_push_ready (SchroDecoder *decoder);
int schro_decoder_push (SchroDecoder *decoder, SchroBuffer *buffer); int schro_decoder_push (SchroDecoder *decoder, SchroBuffer *buffer);
int schro_decoder_set_flushing (SchroDecoder *decoder, int flushing); #ifndef SCHRO_DISABLE_DEPRECATED
int schro_decoder_set_flushing (SchroDecoder *decoder, int flushing) SCHRO_
DEPRECATED;
#endif
void schro_decoder_set_picture_order (SchroDecoder *decoder, int picture_or der); void schro_decoder_set_picture_order (SchroDecoder *decoder, int picture_or der);
int schro_decoder_push_end_of_stream (SchroDecoder *decoder); int schro_decoder_push_end_of_stream (SchroDecoder *decoder);
SchroFrame *schro_decoder_pull (SchroDecoder *decoder); SchroFrame *schro_decoder_pull (SchroDecoder *decoder);
int schro_decoder_wait (SchroDecoder *decoder); int schro_decoder_wait (SchroDecoder *decoder);
void schro_decoder_set_earliest_frame (SchroDecoder *decoder, SchroPictureN umber earliest_frame); void schro_decoder_set_earliest_frame (SchroDecoder *decoder, SchroPictureN umber earliest_frame);
void schro_decoder_set_skip_ratio (SchroDecoder *decoder, double ratio); void schro_decoder_set_skip_ratio (SchroDecoder *decoder, double ratio);
SchroPictureNumber schro_decoder_get_picture_number (SchroDecoder *decoder) ; SchroPictureNumber schro_decoder_get_picture_number (SchroDecoder *decoder) ;
int schro_decoder_need_output_frame (SchroDecoder *decoder); int schro_decoder_need_output_frame (SchroDecoder *decoder);
int schro_decoder_autoparse_wait (SchroDecoder *decoder);
int schro_decoder_autoparse_push (SchroDecoder *decoder, SchroBuffer *buffe
r);
int schro_decoder_autoparse_push_end_of_sequence (SchroDecoder *decoder);
SchroTag* schro_decoder_get_picture_tag (SchroDecoder *decoder);
#ifdef SCHRO_ENABLE_UNSTABLE_API #ifdef SCHRO_ENABLE_UNSTABLE_API
void schro_decoder_decode_parse_header (SchroDecoder *decoder); int schro_decoder_begin_sequence (SchroDecoder *decoder);
void schro_decoder_parse_sequence_header (SchroDecoder *decoder); int schro_decoder_end_sequence (SchroDecoder *decoder);
int schro_decoder_decode_parse_header (SchroUnpack *unpack);
void schro_decoder_parse_sequence_header (SchroDecoderInstance *instance, S
chroUnpack *unpack);
int schro_decoder_compare_sequence_header_buffer (SchroBuffer *a, SchroBuff er *b); int schro_decoder_compare_sequence_header_buffer (SchroBuffer *a, SchroBuff er *b);
void schro_decoder_subband_dc_predict (SchroFrameData *fd); void schro_decoder_subband_dc_predict (SchroFrameData *fd);
/* SchroPicture */ /* SchroPicture */
SchroPicture * schro_picture_new (SchroDecoder *decoder); SchroPicture * schro_picture_new (SchroDecoderInstance *instance);
SchroPicture * schro_picture_ref (SchroPicture *picture); SchroPicture * schro_picture_ref (SchroPicture *picture);
void schro_picture_unref (SchroPicture *picture); void schro_picture_unref (SchroPicture *picture);
void schro_decoder_decode_picture (SchroPicture *picture); int schro_decoder_iterate_picture (SchroDecoderInstance *instance, SchroBuf
void schro_decoder_x_check_references (SchroPicture *picture); fer *buffer, SchroUnpack *unpack, int parse_code);
void schro_decoder_x_decode_motion (SchroPicture *picture); void schro_decoder_parse_picture (SchroPicture *picture, SchroUnpack *unpac
void schro_decoder_x_render_motion (SchroPicture *picture); k);
void schro_decoder_x_decode_residual (SchroPicture *picture); void schro_decoder_parse_picture_header (SchroPicture *picture, SchroUnpack
void schro_decoder_x_wavelet_transform (SchroPicture *picture); *unpack);
void schro_decoder_x_combine (SchroPicture *picture); void schro_decoder_parse_picture_prediction_parameters (SchroPicture *pictu
void schro_decoder_x_upsample (SchroPicture *picture); re, SchroUnpack *unpack);
void schro_decoder_parse_block_data (SchroPicture *picture, SchroUnpack *un
int schro_decoder_iterate_picture (SchroDecoder *decoder); pack);
void schro_decoder_parse_picture (SchroPicture *picture); void schro_decoder_parse_transform_parameters (SchroPicture *picture, Schro
void schro_decoder_parse_picture_header (SchroPicture *picture); Unpack *unpack);
void schro_decoder_parse_picture_prediction_parameters (SchroPicture *pictu void schro_decoder_parse_transform_data (SchroPicture *picture, SchroUnpack
re); *unpack);
void schro_decoder_parse_block_data (SchroPicture *picture); void schro_decoder_parse_lowdelay_transform_data (SchroPicture *picture, Sc
void schro_decoder_parse_transform_parameters (SchroPicture *picture); hroUnpack *unpack);
void schro_decoder_parse_transform_data (SchroPicture *picture);
void schro_decoder_parse_lowdelay_transform_data (SchroPicture *picture);
void schro_decoder_init_subband_frame_data_interleaved (SchroPicture *pictu re); void schro_decoder_init_subband_frame_data_interleaved (SchroPicture *pictu re);
void schro_decoder_init_subband_frame_data (SchroPicture *picture);
void schro_decoder_decode_block_data (SchroPicture *picture); void schro_decoder_decode_block_data (SchroPicture *picture);
void schro_decoder_decode_transform_data (SchroPicture *picture); void schro_decoder_decode_transform_data (SchroPicture *picture);
void schro_decoder_decode_lowdelay_transform_data (SchroPicture *picture); void schro_decoder_decode_lowdelay_transform_data (SchroPicture *picture);
void schro_decoder_decode_macroblock(SchroPicture *picture, void schro_decoder_decode_macroblock(SchroPicture *picture,
SchroArith **arith, SchroUnpack *unpack, int i, int j); SchroArith **arith, SchroUnpack *unpack, int i, int j);
void schro_decoder_decode_prediction_unit(SchroPicture *picture, void schro_decoder_decode_prediction_unit(SchroPicture *picture,
SchroArith **arith, SchroUnpack *unpack, SchroMotionVector *motion_vect ors, SchroArith **arith, SchroUnpack *unpack, SchroMotionVector *motion_vect ors,
int x, int y); int x, int y);
#endif #endif
 End of changes. 29 change blocks. 
54 lines changed or deleted 102 lines changed or added


 schrodomain.h   schrodomain.h 
skipping to change at line 36 skipping to change at line 36
void *priv; void *priv;
} slots[SCHRO_MEMORY_DOMAIN_SLOTS]; } slots[SCHRO_MEMORY_DOMAIN_SLOTS];
}; };
#define SCHRO_EXEC_DOMAIN_CPU 0x0001 #define SCHRO_EXEC_DOMAIN_CPU 0x0001
#define SCHRO_EXEC_DOMAIN_CUDA 0x0002 #define SCHRO_EXEC_DOMAIN_CUDA 0x0002
#define SCHRO_EXEC_DOMAIN_OPENGL 0x0003 #define SCHRO_EXEC_DOMAIN_OPENGL 0x0003
#define SCHRO_MEMORY_DOMAIN_CPU 0x0001 #define SCHRO_MEMORY_DOMAIN_CPU 0x0001
#define SCHRO_MEMORY_DOMAIN_CUDA 0x0002 #define SCHRO_MEMORY_DOMAIN_CUDA 0x0002
#define SCHRO_MEMORY_DOMAIN_OPENGL 0x0003 #define SCHRO_MEMORY_DOMAIN_OPENGL 0x0004
#define SCHRO_MEMORY_DOMAIN_SLOT_ALLOCATED 0x0001 #define SCHRO_MEMORY_DOMAIN_SLOT_ALLOCATED 0x0001
#define SCHRO_MEMORY_DOMAIN_SLOT_IN_USE 0x0002 #define SCHRO_MEMORY_DOMAIN_SLOT_IN_USE 0x0002
SchroMemoryDomain * schro_memory_domain_new (void); SchroMemoryDomain * schro_memory_domain_new (void);
SchroMemoryDomain * schro_memory_domain_new_local (void); SchroMemoryDomain * schro_memory_domain_new_local (void);
void schro_memory_domain_free (SchroMemoryDomain *domain); void schro_memory_domain_free (SchroMemoryDomain *domain);
void * schro_memory_domain_alloc (SchroMemoryDomain *domain, int size); void * schro_memory_domain_alloc (SchroMemoryDomain *domain, int size);
void * schro_memory_domain_alloc_2d (SchroMemoryDomain *domain, void * schro_memory_domain_alloc_2d (SchroMemoryDomain *domain,
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 schroencoder.h   schroencoder.h 
skipping to change at line 31 skipping to change at line 31
typedef enum { typedef enum {
SCHRO_STATE_NEED_FRAME, SCHRO_STATE_NEED_FRAME,
SCHRO_STATE_HAVE_BUFFER, SCHRO_STATE_HAVE_BUFFER,
SCHRO_STATE_AGAIN, SCHRO_STATE_AGAIN,
SCHRO_STATE_END_OF_STREAM SCHRO_STATE_END_OF_STREAM
} SchroStateEnum; } SchroStateEnum;
#ifdef SCHRO_ENABLE_UNSTABLE_API #ifdef SCHRO_ENABLE_UNSTABLE_API
typedef enum { typedef enum {
SCHRO_ENCODER_FRAME_STATE_NEW = 0, SCHRO_ENCODER_FRAME_STAGE_NEW = 0,
SCHRO_ENCODER_FRAME_STATE_ANALYSE = (1<<1), SCHRO_ENCODER_FRAME_STAGE_ANALYSE,
SCHRO_ENCODER_FRAME_STATE_HAVE_GOP = (1<<7), SCHRO_ENCODER_FRAME_STAGE_HAVE_GOP,
SCHRO_ENCODER_FRAME_STATE_HAVE_PARAMS = (1<<8), SCHRO_ENCODER_FRAME_STAGE_HAVE_PARAMS,
SCHRO_ENCODER_FRAME_STATE_PREDICT = (1<<2), SCHRO_ENCODER_FRAME_STAGE_PREDICT_ROUGH,
SCHRO_ENCODER_FRAME_STATE_HAVE_REFS = (1<<10), SCHRO_ENCODER_FRAME_STAGE_PREDICT_PEL,
SCHRO_ENCODER_FRAME_STATE_HAVE_QUANTS = (1<<11), SCHRO_ENCODER_FRAME_STAGE_PREDICT_SUBPEL,
SCHRO_ENCODER_FRAME_STATE_ENCODING = (1<<3), SCHRO_ENCODER_FRAME_STAGE_MODE_DECISION,
SCHRO_ENCODER_FRAME_STATE_RECONSTRUCT = (1<<4), SCHRO_ENCODER_FRAME_STAGE_HAVE_REFS,
SCHRO_ENCODER_FRAME_STATE_POSTANALYSE = (1<<5), SCHRO_ENCODER_FRAME_STAGE_HAVE_QUANTS,
SCHRO_ENCODER_FRAME_STATE_DONE = (1<<6), SCHRO_ENCODER_FRAME_STAGE_ENCODING,
SCHRO_ENCODER_FRAME_STATE_FREE = (1<<9) SCHRO_ENCODER_FRAME_STAGE_RECONSTRUCT,
SCHRO_ENCODER_FRAME_STAGE_POSTANALYSE,
SCHRO_ENCODER_FRAME_STAGE_DONE,
SCHRO_ENCODER_FRAME_STAGE_FREE,
SCHRO_ENCODER_FRAME_STAGE_LAST /* this should be last */
} SchroEncoderFrameStateEnum; } SchroEncoderFrameStateEnum;
#endif #endif
typedef enum { typedef enum {
SCHRO_ENCODER_PERCEPTUAL_CONSTANT, SCHRO_ENCODER_PERCEPTUAL_CONSTANT,
SCHRO_ENCODER_PERCEPTUAL_CCIR959, SCHRO_ENCODER_PERCEPTUAL_CCIR959,
SCHRO_ENCODER_PERCEPTUAL_MOO, SCHRO_ENCODER_PERCEPTUAL_MOO,
SCHRO_ENCODER_PERCEPTUAL_MANOS_SAKRISON SCHRO_ENCODER_PERCEPTUAL_MANOS_SAKRISON
} SchroEncoderPerceptualEnum; } SchroEncoderPerceptualEnum;
typedef enum { typedef enum {
SCHRO_ENCODER_RATE_CONTROL_CONSTANT_NOISE_THRESHOLD, SCHRO_ENCODER_RATE_CONTROL_CONSTANT_NOISE_THRESHOLD,
SCHRO_ENCODER_RATE_CONTROL_CONSTANT_BITRATE, SCHRO_ENCODER_RATE_CONTROL_CONSTANT_BITRATE,
SCHRO_ENCODER_RATE_CONTROL_LOW_DELAY, SCHRO_ENCODER_RATE_CONTROL_LOW_DELAY,
SCHRO_ENCODER_RATE_CONTROL_LOSSLESS, SCHRO_ENCODER_RATE_CONTROL_LOSSLESS,
SCHRO_ENCODER_RATE_CONTROL_CONSTANT_LAMBDA, SCHRO_ENCODER_RATE_CONTROL_CONSTANT_LAMBDA,
SCHRO_ENCODER_RATE_CONTROL_CONSTANT_ERROR SCHRO_ENCODER_RATE_CONTROL_CONSTANT_ERROR,
SCHRO_ENCODER_RATE_CONTROL_CONSTANT_QUALITY
} SchroEncoderRateControlEnum; } SchroEncoderRateControlEnum;
typedef enum { typedef enum {
SCHRO_ENCODER_GOP_ADAPTIVE, SCHRO_ENCODER_GOP_ADAPTIVE,
SCHRO_ENCODER_GOP_INTRA_ONLY, SCHRO_ENCODER_GOP_INTRA_ONLY,
SCHRO_ENCODER_GOP_BACKREF, SCHRO_ENCODER_GOP_BACKREF,
SCHRO_ENCODER_GOP_CHAINED_BACKREF, SCHRO_ENCODER_GOP_CHAINED_BACKREF,
SCHRO_ENCODER_GOP_BIREF, SCHRO_ENCODER_GOP_BIREF,
SCHRO_ENCODER_GOP_CHAINED_BIREF, SCHRO_ENCODER_GOP_CHAINED_BIREF,
} SchroEncoderGOPEnum; } SchroEncoderGOPEnum;
#ifdef SCHRO_ENABLE_UNSTABLE_API #ifdef SCHRO_ENABLE_UNSTABLE_API
typedef int (*SchroEngineIterateFunc) (SchroEncoder *encoder); typedef int (*SchroEngineIterateFunc) (SchroEncoder *encoder);
/* forward declaration */
struct _SchroMotionEst;
struct _SchroRoughME;
struct _SchroEncoderFrame { struct _SchroEncoderFrame {
/*< private >*/ /*< private >*/
int refcount; int refcount;
SchroEncoderFrameStateEnum state; //SchroEncoderFrameStateEnum state;
SchroEncoderFrameStateEnum needed_state; //SchroEncoderFrameStateEnum needed_state;
SchroEncoderFrameStateEnum working; SchroEncoderFrameStateEnum working;
int busy; int busy;
void *priv; void *priv;
unsigned int expired_reference;
/* Bits telling the engine stages which stuff needs to happen */ /* Bits telling the engine stages which stuff needs to happen */
unsigned int need_extension;
unsigned int need_downsampling; unsigned int need_downsampling;
unsigned int need_upsampling;
unsigned int need_filtering; unsigned int need_filtering;
unsigned int need_average_luma; unsigned int need_average_luma;
/* bits indicating that a particular analysis has happened. Mainly /* bits indicating that a particular analysis has happened. Mainly
* for verification */ * for verification */
unsigned int have_estimate_tables; unsigned int have_estimate_tables;
unsigned int have_histograms; unsigned int have_histograms;
unsigned int have_scene_change_score; unsigned int have_scene_change_score;
unsigned int have_downsampling; unsigned int have_downsampling;
unsigned int have_upsampling;
unsigned int have_average_luma; unsigned int have_average_luma;
SchroAsyncStage stages[SCHRO_ENCODER_FRAME_STAGE_LAST];
/* other stuff */ /* other stuff */
int start_sequence_header; int start_sequence_header;
int gop_length; int gop_length;
SchroPictureNumber frame_number; SchroPictureNumber frame_number;
SchroFrame *original_frame; SchroFrame *original_frame;
SchroFrame *filtered_frame; SchroFrame *filtered_frame;
SchroFrame *downsampled_frames[5]; SchroFrame *downsampled_frames[8];
SchroUpsampledFrame *reconstructed_frame; SchroUpsampledFrame *reconstructed_frame;
SchroUpsampledFrame *upsampled_original_frame;
SchroBuffer *sequence_header_buffer; SchroBuffer *sequence_header_buffer;
SchroList *inserted_buffers; SchroList *inserted_buffers;
int output_buffer_size; int output_buffer_size;
SchroBuffer *output_buffer; SchroBuffer *output_buffer;
int presentation_frame; int presentation_frame;
int slot; int slot;
int last_frame; int last_frame;
int is_ref; int is_ref;
skipping to change at line 145 skipping to change at line 162
int stats_dc; int stats_dc;
int stats_global; int stats_global;
int stats_motion; int stats_motion;
int subband_size; int subband_size;
SchroBuffer *subband_buffer; SchroBuffer *subband_buffer;
int16_t *quant_data; int16_t *quant_data;
int16_t *tmpbuf; int *quant_indices[3][SCHRO_LIMIT_SUBBANDS];
int quant_index[3][1+SCHRO_LIMIT_TRANSFORM_DEPTH*3]; int quant_index[3][SCHRO_LIMIT_SUBBANDS];
double est_entropy[3][1+SCHRO_LIMIT_TRANSFORM_DEPTH*3][60]; double est_entropy[3][SCHRO_LIMIT_SUBBANDS][60];
double est_error[3][1+SCHRO_LIMIT_TRANSFORM_DEPTH*3][60]; double est_error[3][SCHRO_LIMIT_SUBBANDS][60];
double subband_info[3][1+SCHRO_LIMIT_TRANSFORM_DEPTH*3];
SchroPack *pack; SchroPack *pack;
SchroParams params; SchroParams params;
SchroEncoder *encoder; SchroEncoder *encoder;
SchroFrame *iwt_frame; SchroFrame *iwt_frame;
SchroFrame *quant_frame;
SchroFrame *prediction_frame; SchroFrame *prediction_frame;
SchroEncoderFrame *previous_frame;
SchroEncoderFrame *ref_frame[2]; SchroEncoderFrame *ref_frame[2];
struct _SchroMotionEst *me;
struct _SchroRoughME *rme[2];
struct _SchroPhaseCorr *phasecorr[2];
SchroMotion *motion; SchroMotion *motion;
SchroList *motion_field_list;
SchroHistogram subband_hists[3][SCHRO_LIMIT_SUBBANDS]; SchroHistogram subband_hists[3][SCHRO_LIMIT_SUBBANDS];
SchroHistogram hist_test; SchroHistogram hist_test;
/* statistics */ /* statistics */
double picture_weight; double picture_weight;
double scene_change_score; double scene_change_score;
double average_luma; double average_luma;
int hard_limit_bits;
int allocated_residual_bits; int allocated_residual_bits;
int allocated_mc_bits; int allocated_mc_bits;
double base_lambda; double base_lambda;
int estimated_residual_bits; int estimated_residual_bits;
int estimated_mc_bits; int estimated_mc_bits;
int actual_residual_bits; int actual_residual_bits;
int actual_mc_bits; int actual_mc_bits;
double mc_error; double mc_error;
double mean_squared_error_luma; double mean_squared_error_luma;
skipping to change at line 198 skipping to change at line 220
struct _SchroEncoder { struct _SchroEncoder {
/*< private >*/ /*< private >*/
SchroAsync *async; SchroAsync *async;
SchroPictureNumber next_frame_number; SchroPictureNumber next_frame_number;
SchroQueue *frame_queue; SchroQueue *frame_queue;
SchroEncoderFrame *reference_pictures[SCHRO_LIMIT_REFERENCE_FRAMES]; SchroEncoderFrame *reference_pictures[SCHRO_LIMIT_REFERENCE_FRAMES];
SchroEncoderFrame *last_frame;
int assemble_packets;
int need_rap; int need_rap;
SchroVideoFormat video_format; SchroVideoFormat video_format;
int version_major; int version_major;
int version_minor; int version_minor;
/* configuration */ /* configuration */
int rate_control; int rate_control;
int bitrate; int bitrate;
int max_bitrate; int max_bitrate;
int min_bitrate; int min_bitrate;
int buffer_size; int buffer_size;
int buffer_level; int buffer_level;
double quality;
double noise_threshold; double noise_threshold;
int gop_structure; int gop_structure;
int queue_depth; int queue_depth;
int perceptual_weighting; int perceptual_weighting;
double perceptual_distance; double perceptual_distance;
int filtering; int filtering;
double filter_value; double filter_value;
int profile; int profile;
int level; int level;
int open_gop;
int au_distance; int au_distance;
schro_bool enable_psnr; schro_bool enable_psnr;
schro_bool enable_ssim; schro_bool enable_ssim;
schro_bool enable_md5; schro_bool enable_md5;
int ref_distance; int ref_distance;
int transform_depth; int transform_depth;
int intra_wavelet; int intra_wavelet;
int inter_wavelet; int inter_wavelet;
int mv_precision; int mv_precision;
int motion_block_size; int motion_block_size;
int motion_block_overlap; int motion_block_overlap;
schro_bool interlaced_coding; schro_bool interlaced_coding;
schro_bool enable_internal_testing; schro_bool enable_internal_testing;
schro_bool enable_noarith; schro_bool enable_noarith;
schro_bool enable_fullscan_estimation; schro_bool enable_fullscan_estimation;
schro_bool enable_hierarchical_estimation; schro_bool enable_hierarchical_estimation;
schro_bool enable_zero_estimation; schro_bool enable_zero_estimation;
schro_bool enable_phasecorr_estimation; schro_bool enable_phasecorr_estimation;
schro_bool enable_bigblock_estimation; schro_bool enable_bigblock_estimation;
schro_bool enable_multiquant;
schro_bool enable_dc_multiquant;
schro_bool enable_global_motion;
int horiz_slices; int horiz_slices;
int vert_slices; int vert_slices;
int codeblock_size;
double magic_dc_metric_offset; double magic_dc_metric_offset;
double magic_subband0_lambda_scale; double magic_subband0_lambda_scale;
double magic_chroma_lambda_scale; double magic_chroma_lambda_scale;
double magic_nonref_lambda_scale; double magic_nonref_lambda_scale;
double magic_allocation_scale; double magic_allocation_scale;
double magic_keyframe_weight; double magic_keyframe_weight;
double magic_scene_change_threshold; double magic_scene_change_threshold;
double magic_inter_p_weight; double magic_inter_p_weight;
double magic_inter_b_weight; double magic_inter_b_weight;
double magic_mc_bailout_limit; double magic_mc_bailout_limit;
double magic_bailout_weight; double magic_bailout_weight;
double magic_error_power; double magic_error_power;
double magic_mc_lambda; double magic_mc_lambda;
double magic_subgroup_length; double magic_subgroup_length;
double magic_lambda; double magic_lambda;
double magic_badblock_multiplier_nonref; double magic_badblock_multiplier_nonref;
double magic_badblock_multiplier_ref; double magic_badblock_multiplier_ref;
double magic_block_search_threshold;
double magic_scan_distance;
/* hooks */ /* hooks */
void (*init_frame) (SchroEncoderFrame *frame); void (*init_frame) (SchroEncoderFrame *frame);
void (*handle_gop) (SchroEncoder *encoder, int i); void (*handle_gop) (SchroEncoder *encoder, int i);
int (*setup_frame) (SchroEncoderFrame *frame); int (*setup_frame) (SchroEncoderFrame *frame);
int (*handle_quants) (SchroEncoder *encoder, int i); int (*handle_quants) (SchroEncoder *encoder, int i);
/* other */ /* other */
int end_of_stream; int end_of_stream;
int end_of_stream_handled; int end_of_stream_handled;
int end_of_stream_pulled; int end_of_stream_pulled;
int completed_eos; int completed_eos;
int prev_offset; int prev_offset;
int force_sequence_header;
SchroPictureNumber au_frame; SchroPictureNumber au_frame;
int next_slot; int next_slot;
int output_slot; int output_slot;
SchroList *inserted_buffers; SchroList *inserted_buffers;
int queue_changed; int queue_changed;
int engine_init; int engine_init;
SchroEngineIterateFunc engine_iterate; SchroEngineIterateFunc engine_iterate;
int quantiser_engine; int quantiser_engine;
double start_time; double start_time;
int downsample_levels;
#if 0
int prefs[SCHRO_PREF_LAST];
#endif
/* internal stuff */ /* internal stuff */
double cycles_per_degree_horiz; double cycles_per_degree_horiz;
double cycles_per_degree_vert; double cycles_per_degree_vert;
double subband_weights[SCHRO_N_WAVELETS][SCHRO_LIMIT_TRANSFORM_DEPTH][SCH RO_LIMIT_SUBBANDS]; double subband_weights[SCHRO_N_WAVELETS][SCHRO_LIMIT_TRANSFORM_DEPTH][SCH RO_LIMIT_SUBBANDS];
SchroHistogramTable intra_hist_tables[60]; SchroHistogramTable intra_hist_tables[60];
int bits_per_picture; int bits_per_picture;
skipping to change at line 315 skipping to change at line 345
/* statistics */ /* statistics */
double average_arith_context_ratio_intra; double average_arith_context_ratio_intra;
double average_arith_context_ratio_inter; double average_arith_context_ratio_inter;
/* engine specific stuff */ /* engine specific stuff */
int gop_picture; int gop_picture;
int quant_slot; int quant_slot;
int intra_ref;
int last_ref; int last_ref;
int last_ref2;
//int next_ref;
//int mid1_ref;
//int mid2_ref;
}; };
#endif #endif
typedef enum { typedef enum {
SCHRO_ENCODER_SETTING_TYPE_BOOLEAN, SCHRO_ENCODER_SETTING_TYPE_BOOLEAN,
SCHRO_ENCODER_SETTING_TYPE_INT, SCHRO_ENCODER_SETTING_TYPE_INT,
SCHRO_ENCODER_SETTING_TYPE_ENUM, SCHRO_ENCODER_SETTING_TYPE_ENUM,
SCHRO_ENCODER_SETTING_TYPE_DOUBLE, SCHRO_ENCODER_SETTING_TYPE_DOUBLE,
SCHRO_ENCODER_SETTING_TYPE_LAST SCHRO_ENCODER_SETTING_TYPE_LAST
} SchroEncoderSettingTypeEnum; } SchroEncoderSettingTypeEnum;
skipping to change at line 343 skipping to change at line 368
char *name; char *name;
SchroEncoderSettingTypeEnum type; SchroEncoderSettingTypeEnum type;
double min; double min;
double max; double max;
double default_value; double default_value;
char **enum_list; char **enum_list;
}; };
#if 0
struct _SchroEncoderSettings {
int transform_depth;
int wavelet_filter_index;
/* stuff we don't handle yet */
int profile;
int level;
int xbsep_luma;
int ybsep_luma;
int xblen_luma;
int yblen_luma;
};
#endif
enum { enum {
SCHRO_MOTION_FIELD_HIER_REF0, SCHRO_MOTION_FIELD_HIER_REF0,
SCHRO_MOTION_FIELD_HIER1_REF0, SCHRO_MOTION_FIELD_HIER1_REF0,
SCHRO_MOTION_FIELD_HIER2_REF0, SCHRO_MOTION_FIELD_HIER2_REF0,
SCHRO_MOTION_FIELD_HIER3_REF0, SCHRO_MOTION_FIELD_HIER3_REF0,
SCHRO_MOTION_FIELD_HIER_REF1, SCHRO_MOTION_FIELD_HIER_REF1,
SCHRO_MOTION_FIELD_HIER1_REF1, SCHRO_MOTION_FIELD_HIER1_REF1,
SCHRO_MOTION_FIELD_HIER2_REF1, SCHRO_MOTION_FIELD_HIER2_REF1,
SCHRO_MOTION_FIELD_HIER3_REF1, SCHRO_MOTION_FIELD_HIER3_REF1,
SCHRO_MOTION_FIELD_PHASECORR_REF0, SCHRO_MOTION_FIELD_PHASECORR_REF0,
skipping to change at line 389 skipping to change at line 398
SchroEncoder * schro_encoder_new (void); SchroEncoder * schro_encoder_new (void);
void schro_encoder_free (SchroEncoder *encoder); void schro_encoder_free (SchroEncoder *encoder);
SchroVideoFormat * schro_encoder_get_video_format (SchroEncoder *encoder); SchroVideoFormat * schro_encoder_get_video_format (SchroEncoder *encoder);
void schro_encoder_set_video_format (SchroEncoder *encoder, void schro_encoder_set_video_format (SchroEncoder *encoder,
SchroVideoFormat *video_format); SchroVideoFormat *video_format);
void schro_encoder_end_of_stream (SchroEncoder *encoder); void schro_encoder_end_of_stream (SchroEncoder *encoder);
int schro_encoder_push_ready (SchroEncoder *encoder); int schro_encoder_push_ready (SchroEncoder *encoder);
void schro_encoder_push_frame (SchroEncoder *encoder, SchroFrame *frame); void schro_encoder_push_frame (SchroEncoder *encoder, SchroFrame *frame);
void schro_encoder_push_frame_full (SchroEncoder *encoder, SchroFrame *fram e, void *priv); void schro_encoder_push_frame_full (SchroEncoder *encoder, SchroFrame *fram e, void *priv);
void schro_encoder_force_sequence_header (SchroEncoder *encoder);
SchroBuffer * schro_encoder_encode_auxiliary_data (SchroEncoder *encoder, SchroBuffer * schro_encoder_encode_auxiliary_data (SchroEncoder *encoder,
SchroAuxiliaryDataID id, void *data, int size); SchroAuxiliaryDataID id, void *data, int size);
void schro_encoder_encode_access_unit_header (SchroEncoder *encoder, SchroP ack *bits);
void schro_encoder_encode_parse_info (SchroPack *bits, int parse_code); void schro_encoder_encode_parse_info (SchroPack *bits, int parse_code);
void schro_encoder_insert_buffer (SchroEncoder *encoder, SchroBuffer *buffe r); void schro_encoder_insert_buffer (SchroEncoder *encoder, SchroBuffer *buffe r);
void schro_encoder_frame_insert_buffer (SchroEncoderFrame *frame, SchroBuff er *buffer); void schro_encoder_frame_insert_buffer (SchroEncoderFrame *frame, SchroBuff er *buffer);
void schro_encoder_start (SchroEncoder *encoder); void schro_encoder_start (SchroEncoder *encoder);
void schro_encoder_set_packet_assembly (SchroEncoder *encoder, int value);
SchroStateEnum schro_encoder_wait (SchroEncoder *encoder); SchroStateEnum schro_encoder_wait (SchroEncoder *encoder);
SchroBuffer * schro_encoder_pull (SchroEncoder *encoder, SchroBuffer * schro_encoder_pull (SchroEncoder *encoder,
int *n_decodable_frames); int *n_decodable_frames);
SchroBuffer * schro_encoder_pull_full (SchroEncoder *encoder, int *presenta tion_frame, SchroBuffer * schro_encoder_pull_full (SchroEncoder *encoder, int *presenta tion_frame,
void **priv); void **priv);
SchroBuffer * schro_encoder_encode_sequence_header (SchroEncoder *encoder);
int schro_encoder_get_n_settings (void); int schro_encoder_get_n_settings (void);
const SchroEncoderSetting *schro_encoder_get_setting_info (int i); const SchroEncoderSetting *schro_encoder_get_setting_info (int i);
void schro_encoder_setting_set_double (SchroEncoder *encoder, const char *n ame, void schro_encoder_setting_set_double (SchroEncoder *encoder, const char *n ame,
double d); double d);
double schro_encoder_setting_get_double (SchroEncoder *encoder, const char *name); double schro_encoder_setting_get_double (SchroEncoder *encoder, const char *name);
#ifdef SCHRO_ENABLE_UNSTABLE_API #ifdef SCHRO_ENABLE_UNSTABLE_API
void schro_encoder_set_default_subband_weights (SchroEncoder *encoder); void schro_encoder_set_default_subband_weights (SchroEncoder *encoder);
skipping to change at line 424 skipping to change at line 435
double (*perceptual_weight)(double)); double (*perceptual_weight)(double));
double schro_encoder_perceptual_weight_constant (double cpd); double schro_encoder_perceptual_weight_constant (double cpd);
double schro_encoder_perceptual_weight_ccir959 (double cpd); double schro_encoder_perceptual_weight_ccir959 (double cpd);
double schro_encoder_perceptual_weight_moo (double cpd); double schro_encoder_perceptual_weight_moo (double cpd);
double schro_encoder_perceptual_weight_manos_sakrison (double cpd); double schro_encoder_perceptual_weight_manos_sakrison (double cpd);
void schro_encoder_init_subbands (SchroEncoderFrame *frame); void schro_encoder_init_subbands (SchroEncoderFrame *frame);
void schro_encoder_encode_subband (SchroEncoderFrame *frame, int component, int index); void schro_encoder_encode_subband (SchroEncoderFrame *frame, int component, int index);
void schro_encoder_encode_subband_noarith (SchroEncoderFrame *frame, int co mponent, int index); void schro_encoder_encode_subband_noarith (SchroEncoderFrame *frame, int co mponent, int index);
void schro_encoder_analyse_picture (SchroEncoderFrame *frame); void schro_encoder_analyse_picture (SchroAsyncStage *stage);
void schro_encoder_predict_picture (SchroEncoderFrame *frame); void schro_encoder_predict_rough_picture (SchroAsyncStage *stage);
void schro_encoder_encode_picture (SchroEncoderFrame *frame); void schro_encoder_predict_pel_picture (SchroAsyncStage *stage);
void schro_encoder_reconstruct_picture (SchroEncoderFrame *frame); void schro_encoder_predict_subpel_picture (SchroAsyncStage *stage);
void schro_encoder_postanalyse_picture (SchroEncoderFrame *frame);
void schro_encoder_encode_picture_all (SchroEncoderFrame *frame); void schro_encoder_fullpel_predict_picture (SchroAsyncStage *stage);
void schro_encoder_mode_decision (SchroAsyncStage *stage);
void schro_encoder_encode_picture (SchroAsyncStage *stage);
void schro_encoder_reconstruct_picture (SchroAsyncStage *stage);
void schro_encoder_postanalyse_picture (SchroAsyncStage *stage);
SchroFrame * schro_encoder_frame_queue_get (SchroEncoder *encoder, SchroFrame * schro_encoder_frame_queue_get (SchroEncoder *encoder,
SchroPictureNumber frame_number); SchroPictureNumber frame_number);
void schro_encoder_frame_queue_remove (SchroEncoder *encoder, void schro_encoder_frame_queue_remove (SchroEncoder *encoder,
SchroPictureNumber frame_number); SchroPictureNumber frame_number);
SchroEncoderFrame * schro_encoder_reference_get (SchroEncoder *encoder, SchroEncoderFrame * schro_encoder_reference_get (SchroEncoder *encoder,
SchroPictureNumber frame_number); SchroPictureNumber frame_number);
void schro_encoder_encode_picture_header (SchroEncoderFrame *frame); void schro_encoder_encode_picture_header (SchroEncoderFrame *frame);
SchroBuffer * schro_encoder_encode_end_of_stream (SchroEncoder *encoder); SchroBuffer * schro_encoder_encode_end_of_stream (SchroEncoder *encoder);
void schro_encoder_clean_up_transform (SchroEncoderFrame *frame); void schro_encoder_clean_up_transform (SchroEncoderFrame *frame);
void schro_encoder_choose_quantisers (SchroEncoderFrame *frame); void schro_encoder_choose_quantisers (SchroEncoderFrame *frame);
SchroBuffer * schro_encoder_encode_sequence_header (SchroEncoder *encoder);
void schro_encoder_output_push (SchroEncoder *encoder, void schro_encoder_output_push (SchroEncoder *encoder,
SchroBuffer *buffer, int slot, int presentation_frame); SchroBuffer *buffer, int slot, int presentation_frame);
SchroEncoderFrame * schro_encoder_frame_new (SchroEncoder *encoder); SchroEncoderFrame * schro_encoder_frame_new (SchroEncoder *encoder);
void schro_encoder_frame_ref (SchroEncoderFrame *frame); void schro_encoder_frame_ref (SchroEncoderFrame *frame);
void schro_encoder_frame_unref (SchroEncoderFrame *frame); void schro_encoder_frame_unref (SchroEncoderFrame *frame);
void schro_encoder_encode_lowdelay_transform_data (SchroEncoderFrame *frame ); void schro_encoder_encode_lowdelay_transform_data (SchroEncoderFrame *frame );
void schro_encoder_estimate_entropy (SchroEncoderFrame *frame); void schro_encoder_estimate_entropy (SchroEncoderFrame *frame);
void schro_encoder_recalculate_allocations (SchroEncoder *encoder); void schro_encoder_recalculate_allocations (SchroEncoder *encoder);
void schro_encoder_calculate_test_info (SchroEncoderFrame *frame); void schro_encoder_calculate_test_info (SchroEncoderFrame *frame);
void schro_encoder_init_error_tables (SchroEncoder *encoder); void schro_encoder_init_error_tables (SchroEncoder *encoder);
void schro_encoder_frame_set_quant_index (SchroEncoderFrame *frame, int com
ponent,
int index, int x, int y, int quant_index);
#endif #endif
SCHRO_END_DECLS SCHRO_END_DECLS
#endif #endif
 End of changes. 37 change blocks. 
55 lines changed or deleted 74 lines changed or added


 schroframe.h   schroframe.h 
skipping to change at line 40 skipping to change at line 40
SCHRO_FRAME_FORMAT_S16_420 = 0x07, SCHRO_FRAME_FORMAT_S16_420 = 0x07,
SCHRO_FRAME_FORMAT_S32_444 = 0x08, SCHRO_FRAME_FORMAT_S32_444 = 0x08,
SCHRO_FRAME_FORMAT_S32_422 = 0x09, SCHRO_FRAME_FORMAT_S32_422 = 0x09,
SCHRO_FRAME_FORMAT_S32_420 = 0x0b, SCHRO_FRAME_FORMAT_S32_420 = 0x0b,
/* indirectly supported */ /* indirectly supported */
SCHRO_FRAME_FORMAT_YUYV = 0x100, /* YUYV order */ SCHRO_FRAME_FORMAT_YUYV = 0x100, /* YUYV order */
SCHRO_FRAME_FORMAT_UYVY = 0x101, /* UYVY order */ SCHRO_FRAME_FORMAT_UYVY = 0x101, /* UYVY order */
SCHRO_FRAME_FORMAT_AYUV = 0x102, SCHRO_FRAME_FORMAT_AYUV = 0x102,
SCHRO_FRAME_FORMAT_ARGB = 0x103 SCHRO_FRAME_FORMAT_ARGB = 0x103,
SCHRO_FRAME_FORMAT_RGB = 0x104,
SCHRO_FRAME_FORMAT_v216 = 0x105,
SCHRO_FRAME_FORMAT_v210 = 0x106
} SchroFrameFormat; } SchroFrameFormat;
#define SCHRO_FRAME_FORMAT_DEPTH(format) ((format) & 0xc) #define SCHRO_FRAME_FORMAT_DEPTH(format) ((format) & 0xc)
#define SCHRO_FRAME_FORMAT_DEPTH_U8 0x00 #define SCHRO_FRAME_FORMAT_DEPTH_U8 0x00
#define SCHRO_FRAME_FORMAT_DEPTH_S16 0x04 #define SCHRO_FRAME_FORMAT_DEPTH_S16 0x04
#define SCHRO_FRAME_FORMAT_DEPTH_S32 0x08 #define SCHRO_FRAME_FORMAT_DEPTH_S32 0x08
#define SCHRO_FRAME_FORMAT_H_SHIFT(format) ((format) & 0x1) #define SCHRO_FRAME_FORMAT_H_SHIFT(format) ((format) & 0x1)
#define SCHRO_FRAME_FORMAT_V_SHIFT(format) (((format)>>1) & 0x1) #define SCHRO_FRAME_FORMAT_V_SHIFT(format) (((format)>>1) & 0x1)
skipping to change at line 84 skipping to change at line 87
int width; int width;
int height; int height;
SchroFrameData components[3]; SchroFrameData components[3];
int is_virtual; int is_virtual;
int cached_lines[3][SCHRO_FRAME_CACHE_SIZE]; int cached_lines[3][SCHRO_FRAME_CACHE_SIZE];
SchroFrame *virt_frame1; SchroFrame *virt_frame1;
SchroFrame *virt_frame2; SchroFrame *virt_frame2;
void (*render_line) (SchroFrame *frame, void *dest, int component, int i) ; void (*render_line) (SchroFrame *frame, void *dest, int component, int i) ;
void *virt_priv;
void *virt_priv2;
int extension;
}; };
struct _SchroUpsampledFrame { struct _SchroUpsampledFrame {
SchroFrame *frames[4]; SchroFrame *frames[4];
void *components[3]; void *components[3];
}; };
#define SCHRO_FRAME_DATA_GET_LINE(fd,i) (SCHRO_OFFSET((fd)->data,(fd)->stri de*(i))) #define SCHRO_FRAME_DATA_GET_LINE(fd,i) (SCHRO_OFFSET((fd)->data,(fd)->stri de*(i)))
#define SCHRO_FRAME_DATA_GET_PIXEL_U8(fd,i,j) ((uint8_t *)SCHRO_OFFSET((fd) ->data,(fd)->stride*(j)+(i))) #define SCHRO_FRAME_DATA_GET_PIXEL_U8(fd,i,j) ((uint8_t *)SCHRO_OFFSET((fd) ->data,(fd)->stride*(j)+(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_S16(fd,i,j) ((int16_t *)SCHRO_OFFSET((fd )->data,(fd)->stride*(j)+(i)*sizeof(int16_t)))
SchroFrame * schro_frame_new (void); SchroFrame * schro_frame_new (void);
SchroFrame * schro_frame_new_and_alloc (SchroMemoryDomain *domain, SchroFrame * schro_frame_new_and_alloc (SchroMemoryDomain *domain,
SchroFrameFormat format, int width, int height); SchroFrameFormat format, int width, int height);
SchroFrame * schro_frame_new_from_data_I420 (void *data, int width, int hei ght); SchroFrame * schro_frame_new_from_data_I420 (void *data, int width, int hei ght);
SchroFrame * schro_frame_new_from_data_YV12 (void *data, int width, int hei ght); SchroFrame * schro_frame_new_from_data_YV12 (void *data, int width, int hei ght);
SchroFrame * schro_frame_new_from_data_YUY2 (void *data, int width, int hei ght); SchroFrame * schro_frame_new_from_data_YUY2 (void *data, int width, int hei ght);
SchroFrame * schro_frame_new_from_data_UYVY (void *data, int width, int hei ght); SchroFrame * schro_frame_new_from_data_UYVY (void *data, int width, int hei ght);
SchroFrame * schro_frame_new_from_data_UYVY_full (void *data, int width, in t height, int stride); SchroFrame * schro_frame_new_from_data_UYVY_full (void *data, int width, in t height, int stride);
SchroFrame * schro_frame_new_from_data_AYUV (void *data, int width, int hei ght); SchroFrame * schro_frame_new_from_data_AYUV (void *data, int width, int hei ght);
SchroFrame * schro_frame_new_from_data_v216 (void *data, int width, int hei
ght);
SchroFrame * schro_frame_new_from_data_v210 (void *data, int width, int hei
ght);
void schro_frame_set_free_callback (SchroFrame *frame, void schro_frame_set_free_callback (SchroFrame *frame,
SchroFrameFreeFunc free_func, void *priv); SchroFrameFreeFunc free_func, void *priv);
void schro_frame_unref (SchroFrame *frame); void schro_frame_unref (SchroFrame *frame);
SchroFrame *schro_frame_ref (SchroFrame *frame); SchroFrame *schro_frame_ref (SchroFrame *frame);
SchroFrame *schro_frame_dup (SchroFrame *frame); SchroFrame *schro_frame_dup (SchroFrame *frame);
SchroFrame *schro_frame_clone (SchroMemoryDomain *domain, SchroFrame *frame ); SchroFrame *schro_frame_clone (SchroMemoryDomain *domain, SchroFrame *frame );
void schro_frame_convert (SchroFrame *dest, SchroFrame *src); void schro_frame_convert (SchroFrame *dest, SchroFrame *src);
void schro_frame_add (SchroFrame *dest, SchroFrame *src); void schro_frame_add (SchroFrame *dest, SchroFrame *src);
void schro_frame_subtract (SchroFrame *dest, SchroFrame *src); void schro_frame_subtract (SchroFrame *dest, SchroFrame *src);
void schro_frame_shift_left (SchroFrame *frame, int shift); void schro_frame_shift_left (SchroFrame *frame, int shift);
void schro_frame_shift_right (SchroFrame *frame, int shift); void schro_frame_shift_right (SchroFrame *frame, int shift);
void schro_frame_clear (SchroFrame *frame);
void schro_frame_downsample (SchroFrame *dest, SchroFrame *src); void schro_frame_downsample (SchroFrame *dest, SchroFrame *src);
void schro_frame_upsample_horiz (SchroFrame *dest, SchroFrame *src); void schro_frame_upsample_horiz (SchroFrame *dest, SchroFrame *src);
void schro_frame_upsample_vert (SchroFrame *dest, SchroFrame *src); void schro_frame_upsample_vert (SchroFrame *dest, SchroFrame *src);
double schro_frame_calculate_average_luma (SchroFrame *frame); double schro_frame_calculate_average_luma (SchroFrame *frame);
SchroFrame * schro_frame_convert_to_444 (SchroFrame *frame); SchroFrame * schro_frame_convert_to_444 (SchroFrame *frame);
void schro_frame_md5 (SchroFrame *frame, uint32_t *state); void schro_frame_md5 (SchroFrame *frame, uint32_t *state);
#ifdef SCHRO_ENABLE_UNSTABLE_API #ifdef SCHRO_ENABLE_UNSTABLE_API
SchroFrame * schro_frame_new_and_alloc_extended (SchroMemoryDomain *domain,
SchroFrameFormat format, int width, int height, int extension);
SchroFrame *schro_frame_dup_extended (SchroFrame *frame, int extension);
void schro_frame_edge_extend (SchroFrame *frame, int width, int height); void schro_frame_edge_extend (SchroFrame *frame, int width, int height);
void schro_frame_zero_extend (SchroFrame *frame, int width, int height); void schro_frame_zero_extend (SchroFrame *frame, int width, int height);
void schro_frame_mark (SchroFrame *frame, int value); void schro_frame_mark (SchroFrame *frame, int value);
void schro_frame_mc_edgeextend (SchroFrame *frame);
void schro_frame_data_get_codeblock (SchroFrameData *dest, SchroFrameData * src, void schro_frame_data_get_codeblock (SchroFrameData *dest, SchroFrameData * src,
int x, int y, int horiz_codeblocks, int vert_codeblocks); int x, int y, int horiz_codeblocks, int vert_codeblocks);
SchroUpsampledFrame * schro_upsampled_frame_new (SchroFrame *frame); SchroUpsampledFrame * schro_upsampled_frame_new (SchroFrame *frame);
void schro_upsampled_frame_free (SchroUpsampledFrame *df); void schro_upsampled_frame_free (SchroUpsampledFrame *df);
void schro_upsampled_frame_upsample (SchroUpsampledFrame *df); void schro_upsampled_frame_upsample (SchroUpsampledFrame *df);
#ifdef ENABLE_MOTION_REF
int schro_upsampled_frame_get_pixel_prec0 (SchroUpsampledFrame *upframe, in t k, int schro_upsampled_frame_get_pixel_prec0 (SchroUpsampledFrame *upframe, in t k,
int x, int y); int x, int y);
int schro_upsampled_frame_get_pixel_prec1 (SchroUpsampledFrame *upframe, in t k, int schro_upsampled_frame_get_pixel_prec1 (SchroUpsampledFrame *upframe, in t k,
int x, int y); int x, int y);
int schro_upsampled_frame_get_pixel_prec3 (SchroUpsampledFrame *upframe, in t k, int schro_upsampled_frame_get_pixel_prec3 (SchroUpsampledFrame *upframe, in t k,
int x, int y); int x, int y);
int schro_upsampled_frame_get_pixel_precN (SchroUpsampledFrame *upframe, in t k, int schro_upsampled_frame_get_pixel_precN (SchroUpsampledFrame *upframe, in t k,
int x, int y, int mv_precision); int x, int y, int mv_precision);
#endif
void schro_upsampled_frame_get_block_precN (SchroUpsampledFrame *upframe, i nt k, void schro_upsampled_frame_get_block_precN (SchroUpsampledFrame *upframe, i nt k,
int x, int y, int prec, SchroFrameData *fd); int x, int y, int prec, SchroFrameData *dest);
void schro_upsampled_frame_get_block_fast_precN (SchroUpsampledFrame *upfra me, int k, void schro_upsampled_frame_get_block_fast_precN (SchroUpsampledFrame *upfra me, int k,
int x, int y, int prec, SchroFrameData *fd); int x, int y, int prec, SchroFrameData *dest, SchroFrameData *fd);
void schro_upsampled_frame_get_subdata_prec0 (SchroUpsampledFrame *upframe,
int k, int x, int y, SchroFrameData *fd);
void schro_upsampled_frame_get_subdata_prec1 (SchroUpsampledFrame *upframe,
int k, int x, int y, SchroFrameData *fd);
void schro_frame_get_subdata (SchroFrame *frame, SchroFrameData *fd, void schro_frame_get_subdata (SchroFrame *frame, SchroFrameData *fd,
int comp, int x, int y); int comp, int x, int y);
void schro_frame_split_fields (SchroFrame *dest1, SchroFrame *dest2, SchroF rame *src); void schro_frame_split_fields (SchroFrame *dest1, SchroFrame *dest2, SchroF rame *src);
#endif #endif
SCHRO_END_DECLS SCHRO_END_DECLS
 End of changes. 10 change blocks. 
3 lines changed or deleted 25 lines changed or added


 schrohistogram.h   schrohistogram.h 
#ifndef __SCHRO_SCHRO_HISTOGRAM_H__ #ifndef __SCHRO_SCHRO_HISTOGRAM_H__
#define __SCHRO_SCHRO_HISTOGRAM_H__ #define __SCHRO_SCHRO_HISTOGRAM_H__
#include <schroedinger/schroutils.h> #include <schroedinger/schroutils.h>
#include <schroedinger/schroframe.h>
SCHRO_BEGIN_DECLS SCHRO_BEGIN_DECLS
#define SCHRO_HISTOGRAM_SHIFT 3 #define SCHRO_HISTOGRAM_SHIFT 3
#define SCHRO_HISTOGRAM_SIZE ((16-SCHRO_HISTOGRAM_SHIFT)*(1<<SCHRO_HISTOGRA M_SHIFT)) #define SCHRO_HISTOGRAM_SIZE ((16-SCHRO_HISTOGRAM_SHIFT)*(1<<SCHRO_HISTOGRA M_SHIFT))
typedef struct _SchroHistogram SchroHistogram; typedef struct _SchroHistogram SchroHistogram;
typedef struct _SchroHistogramTable SchroHistogramTable; typedef struct _SchroHistogramTable SchroHistogramTable;
struct _SchroHistogram { struct _SchroHistogram {
skipping to change at line 45 skipping to change at line 46
double (*func)(int value, void *priv), void *priv); double (*func)(int value, void *priv), void *priv);
double schro_histogram_apply_table (SchroHistogram *hist, double schro_histogram_apply_table (SchroHistogram *hist,
SchroHistogramTable *table); SchroHistogramTable *table);
double schro_histogram_apply_table_range (SchroHistogram *hist, double schro_histogram_apply_table_range (SchroHistogram *hist,
SchroHistogramTable *table, int start, int end); SchroHistogramTable *table, int start, int end);
double schro_histogram_estimate_noise_level (SchroHistogram *hist); double schro_histogram_estimate_noise_level (SchroHistogram *hist);
double schro_histogram_estimate_slope (SchroHistogram *hist); double schro_histogram_estimate_slope (SchroHistogram *hist);
double schro_histogram_estimate_entropy (SchroHistogram *hist, int quant_in dex, double schro_histogram_estimate_entropy (SchroHistogram *hist, int quant_in dex,
int noarith); int noarith);
void schro_frame_data_generate_histogram (SchroFrameData *fd,
SchroHistogram *hist, int skip);
void schro_frame_data_generate_histogram_dc_predict (SchroFrameData *fd,
SchroHistogram *hist, int skip, int x, int y);
#endif #endif
SCHRO_END_DECLS SCHRO_END_DECLS
#endif #endif
 End of changes. 2 change blocks. 
0 lines changed or deleted 5 lines changed or added


 schrolist.h   schrolist.h 
skipping to change at line 25 skipping to change at line 25
struct _SchroList { struct _SchroList {
void **members; void **members;
int n; int n;
int n_alloc; int n_alloc;
SchroListFreeFunc free; SchroListFreeFunc free;
void *priv; void *priv;
}; };
SchroList *schro_list_new (void); SchroList *schro_list_new (void);
SchroList *schro_list_new_full (SchroListFreeFunc free, void *priv); SchroList *schro_list_new_full (SchroListFreeFunc freefunc, void *priv);
void schro_list_free (SchroList *list); void schro_list_free (SchroList *list);
void *schro_list_get (SchroList *list, int i); void *schro_list_get (SchroList *list, int i);
int schro_list_get_size (SchroList *list); int schro_list_get_size (SchroList *list);
void schro_list_append (SchroList *list, void *value); void schro_list_append (SchroList *list, void *value);
void schro_list_insert (SchroList *list, int i, void *value); void schro_list_insert (SchroList *list, int i, void *value);
void *schro_list_remove (SchroList *list, int i); void *schro_list_remove (SchroList *list, int i);
void schro_list_delete (SchroList *list, int i); void schro_list_delete (SchroList *list, int i);
void *schro_list_replace (SchroList *list, int i, void *value); void *schro_list_replace (SchroList *list, int i, void *value);
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 schromotion.h   schromotion.h 
skipping to change at line 24 skipping to change at line 24
typedef struct _SchroMotionScan SchroMotionScan; typedef struct _SchroMotionScan SchroMotionScan;
#ifdef SCHRO_ENABLE_UNSTABLE_API #ifdef SCHRO_ENABLE_UNSTABLE_API
struct _SchroMotionVector { struct _SchroMotionVector {
unsigned int pred_mode : 2; unsigned int pred_mode : 2;
unsigned int using_global : 1; unsigned int using_global : 1;
unsigned int split : 2; unsigned int split : 2;
unsigned int unused : 3; unsigned int unused : 3;
unsigned int scan : 8; unsigned int scan : 8;
unsigned int metric : 16; unsigned int metric : 16;
int16_t dx[2]; union {
int16_t dy[2]; struct {
}; int16_t dx[2];
int16_t dy[2];
struct _SchroMotionVectorDC { } vec;
unsigned int pred_mode : 2; struct {
unsigned int using_global : 1; int16_t dc[3];
unsigned int split : 2; } dc;
unsigned int unused : 3; } u;
unsigned int scan : 8;
unsigned int metric : 16;
int16_t dc[3];
uint16_t _padding1;
}; };
struct _SchroMotionField { struct _SchroMotionField {
int x_num_blocks; int x_num_blocks;
int y_num_blocks; int y_num_blocks;
SchroMotionVector *motion_vectors; SchroMotionVector *motion_vectors;
}; };
struct _SchroMotion { struct _SchroMotion {
SchroUpsampledFrame *src1; SchroUpsampledFrame *src1;
SchroUpsampledFrame *src2; SchroUpsampledFrame *src2;
SchroMotionVector *motion_vectors; SchroMotionVector *motion_vectors;
SchroParams *params; SchroParams *params;
int sx_max;
int sy_max;
uint8_t *tmpdata; uint8_t *tmpdata;
uint8_t *blocks[3];
int strides[3];
int ref_weight_precision; int ref_weight_precision;
int ref1_weight; int ref1_weight;
int ref2_weight; int ref2_weight;
int mv_precision; int mv_precision;
int xoffset; int xoffset;
int yoffset; int yoffset;
int xbsep; int xbsep;
int ybsep; int ybsep;
int xblen; int xblen;
int yblen; int yblen;
SchroFrameData block; SchroFrameData block;
SchroFrameData alloc_block;
SchroFrameData obmc_weight; SchroFrameData obmc_weight;
SchroFrameData tmp_block_ref[2];
SchroFrameData alloc_block_ref[2];
SchroFrameData block_ref[2];
int weight_x[SCHRO_LIMIT_BLOCK_SIZE]; int weight_x[SCHRO_LIMIT_BLOCK_SIZE];
int weight_y[SCHRO_LIMIT_BLOCK_SIZE]; int weight_y[SCHRO_LIMIT_BLOCK_SIZE];
int width; int width;
int height; int height;
int max_fast_x; int max_fast_x;
int max_fast_y; int max_fast_y;
}; };
#define SCHRO_MOTION_GET_BLOCK(motion,x,y) \ #define SCHRO_MOTION_GET_BLOCK(motion,x,y) \
((motion)->motion_vectors+(y)*(motion)->params->x_num_blocks + (x)) ((motion)->motion_vectors+(y)*(motion)->params->x_num_blocks + (x))
#define SCHRO_MOTION_GET_DC_BLOCK(motion,x,y) \
((SchroMotionVectorDC *)SCHRO_MOTION_GET_BLOCK(motion,x,y))
SchroMotion * schro_motion_new (SchroParams *params, SchroMotion * schro_motion_new (SchroParams *params,
SchroUpsampledFrame *ref1, SchroUpsampledFrame *ref2); SchroUpsampledFrame *ref1, SchroUpsampledFrame *ref2);
void schro_motion_free (SchroMotion *motion); void schro_motion_free (SchroMotion *motion);
int schro_motion_verify (SchroMotion *mf); int schro_motion_verify (SchroMotion *mf);
void schro_motion_render_ref (SchroMotion *motion, SchroFrame *dest); void schro_motion_render_ref (SchroMotion *motion, SchroFrame *dest);
void schro_motion_render (SchroMotion *motion, SchroFrame *dest); void schro_motion_render (SchroMotion *motion, SchroFrame *dest);
void schro_motion_init_obmc_weight (SchroMotion *motion);
void schro_motion_render_fast (SchroMotion *motion, SchroFrame *dest);
int schro_motion_render_fast_allowed (SchroMotion *motion);
void schro_motion_vector_prediction (SchroMotion *motion, void schro_motion_vector_prediction (SchroMotion *motion,
int x, int y, int *pred_x, int *pred_y, int mode); int x, int y, int *pred_x, int *pred_y, int mode);
int schro_motion_split_prediction (SchroMotion *motion, int x, int y); int schro_motion_split_prediction (SchroMotion *motion, int x, int y);
int schro_motion_get_mode_prediction (SchroMotion *motion, int x, int y); int schro_motion_get_mode_prediction (SchroMotion *motion, int x, int y);
void schro_motion_dc_prediction (SchroMotion *motion, void schro_motion_dc_prediction (SchroMotion *motion,
int x, int y, int *pred); int x, int y, int *pred);
int schro_motion_get_global_prediction (SchroMotion *motion, int schro_motion_get_global_prediction (SchroMotion *motion,
int x, int y); int x, int y);
 End of changes. 7 change blocks. 
20 lines changed or deleted 18 lines changed or added


 schromotionest.h   schromotionest.h 
#ifndef __SCHRO_MOTIONEST_H__ #ifndef __SCHRO_MOTIONEST_H__
#define __SCHRO_MOTIONEST_H__ #define __SCHRO_MOTIONEST_H__
#include <schroedinger/schroencoder.h> #include <schroedinger/schroencoder.h>
SCHRO_BEGIN_DECLS SCHRO_BEGIN_DECLS
typedef struct _SchroMotionEst SchroMotionEst; typedef struct _SchroMotionEst SchroMotionEst;
typedef struct _SchroRoughME SchroRoughME;
typedef struct _SchroBlock SchroBlock; typedef struct _SchroBlock SchroBlock;
#ifdef SCHRO_ENABLE_UNSTABLE_API #ifdef SCHRO_ENABLE_UNSTABLE_API
#define SCHRO_MAX_HIER_LEVELS 8
struct _SchroMotionEst { struct _SchroMotionEst {
SchroEncoderFrame *encoder_frame; SchroEncoderFrame *encoder_frame;
SchroParams *params; SchroParams *params;
double lambda; double lambda;
SchroUpsampledFrame *src0; SchroFrame *downsampled_src0[SCHRO_MAX_HIER_LEVELS];
SchroFrame *downsampled_src0[5]; SchroFrame *downsampled_src1[SCHRO_MAX_HIER_LEVELS];
SchroUpsampledFrame *src1;
SchroFrame *downsampled_src1[5];
SchroMotion *motion; SchroMotion *motion;
SchroBlock *sblocks; SchroBlock *sblocks;
SchroMotionField *downsampled_mf[2][5]; //SchroMotionField *downsampled_mf[2][8];
int scan_distance;
int badblocks; int badblocks;
double hier_score; double hier_score;
}; };
struct _SchroRoughME {
SchroEncoderFrame *encoder_frame;
SchroEncoderFrame *ref_frame;
SchroMotionField *motion_fields[SCHRO_MAX_HIER_LEVELS];
};
struct _SchroBlock { struct _SchroBlock {
int valid; int valid;
int error; int error;
int entropy; int entropy;
double score; double score;
SchroMotionVector mv[4][4]; SchroMotionVector mv[4][4];
}; };
SchroMotionEst *schro_motionest_new (SchroEncoderFrame *frame); SchroMotionEst *schro_motionest_new (SchroEncoderFrame *frame);
void schro_motionest_free (SchroMotionEst *me); void schro_motionest_free (SchroMotionEst *me);
void schro_encoder_motion_predict (SchroEncoderFrame *frame); SchroRoughME * schro_rough_me_new (SchroEncoderFrame *frame, SchroEncoderFr
ame *ref);
void schro_rough_me_free (SchroRoughME *rme);
void schro_rough_me_heirarchical_scan (SchroRoughME *rme);
void schro_rough_me_heirarchical_scan_nohint (SchroRoughME *rme, int shift,
int distance);
void schro_rough_me_heirarchical_scan_hint (SchroRoughME *rme, int shift,
int distance);
void schro_encoder_global_estimation (SchroMotionEst *me); void schro_encoder_motion_predict_rough (SchroEncoderFrame *frame);
void schro_encoder_motion_predict_pel (SchroEncoderFrame *frame);
void schro_encoder_motion_predict_subpel (SchroEncoderFrame *frame);
void schro_encoder_global_estimation (SchroEncoderFrame *frame);
SchroMotionField * schro_motion_field_new (int x_num_blocks, int y_num_bloc ks); SchroMotionField * schro_motion_field_new (int x_num_blocks, int y_num_bloc ks);
void schro_motion_field_free (SchroMotionField *field); void schro_motion_field_free (SchroMotionField *field);
void schro_motion_field_scan (SchroMotionField *field, SchroParams *params, SchroFrame *frame, SchroFrame *ref, int dist); void schro_motion_field_scan (SchroMotionField *field, SchroParams *params, SchroFrame *frame, SchroFrame *ref, int dist);
void schro_motion_field_inherit (SchroMotionField *field, SchroMotionField *parent); void schro_motion_field_inherit (SchroMotionField *field, SchroMotionField *parent);
void schro_motion_field_copy (SchroMotionField *field, SchroMotionField *pa rent); void schro_motion_field_copy (SchroMotionField *field, SchroMotionField *pa rent);
void schro_motion_field_global_estimation (SchroMotionField *mf,
SchroGlobalMotion *gm, int mv_precision);
int schro_frame_get_metric (SchroFrame *frame1, int x1, int y1, int schro_frame_get_metric (SchroFrame *frame1, int x1, int y1,
SchroFrame *frame2, int x2, int y2); SchroFrame *frame2, int x2, int y2);
void schro_motion_field_lshift (SchroMotionField *mf, int n); void schro_motion_field_lshift (SchroMotionField *mf, int n);
int schro_motion_estimate_entropy (SchroMotion *motion); int schro_motion_estimate_entropy (SchroMotion *motion);
int schro_motion_block_estimate_entropy (SchroMotion *motion, int i, int j) ; int schro_motion_block_estimate_entropy (SchroMotion *motion, int i, int j) ;
int schro_motion_superblock_estimate_entropy (SchroMotion *motion, int i, i nt j); int schro_motion_superblock_estimate_entropy (SchroMotion *motion, int i, i nt j);
int schro_motion_superblock_try_estimate_entropy (SchroMotion *motion, int i, int schro_motion_superblock_try_estimate_entropy (SchroMotion *motion, int i,
int j, SchroBlock *block); int j, SchroBlock *block);
 End of changes. 8 change blocks. 
9 lines changed or deleted 27 lines changed or added


 schroparams.h   schroparams.h 
skipping to change at line 96 skipping to change at line 96
int schro_params_set_block_params (SchroParams *params, int index); int schro_params_set_block_params (SchroParams *params, int index);
int schro_params_get_block_params (SchroParams *params); int schro_params_get_block_params (SchroParams *params);
int schro_params_verify_block_params (SchroParams *params); int schro_params_verify_block_params (SchroParams *params);
void schro_params_set_default_codeblock (SchroParams *params); void schro_params_set_default_codeblock (SchroParams *params);
schro_bool schro_params_is_default_codeblock (SchroParams *params); schro_bool schro_params_is_default_codeblock (SchroParams *params);
void schro_subband_get_frame_data (SchroFrameData *dest, void schro_subband_get_frame_data (SchroFrameData *dest,
SchroFrame *frame, int component, int position, SchroParams *params); SchroFrame *frame, int component, int position, SchroParams *params);
void schro_subband_get (SchroFrame *frame, int component, int position,
SchroParams *params, int16_t **data, int *stride, int *width, int *heig
ht);
int schro_subband_get_position (int index); int schro_subband_get_position (int index);
void schro_params_set_default_quant_matrix (SchroParams *params); void schro_params_set_default_quant_matrix (SchroParams *params);
schro_bool schro_params_is_default_quant_matrix (SchroParams *params); schro_bool schro_params_is_default_quant_matrix (SchroParams *params);
/* FIXME should be SchroFrameFormat */ /* FIXME should be SchroFrameFormat */
int schro_params_get_frame_format (int depth, int schro_params_get_frame_format (int depth,
SchroChromaFormat chroma_format); SchroChromaFormat chroma_format);
/* FIXME should be moved */ /* FIXME should be moved */
void schro_frame_iwt_transform (SchroFrame *frame, SchroParams *params, void schro_frame_iwt_transform (SchroFrame *frame, SchroParams *params);
int16_t *tmp); void schro_frame_inverse_iwt_transform (SchroFrame *frame, SchroParams *par
void schro_frame_inverse_iwt_transform (SchroFrame *frame, SchroParams *par ams);
ams,
int16_t *tmp);
#endif #endif
SCHRO_END_DECLS SCHRO_END_DECLS
#endif #endif
 End of changes. 2 change blocks. 
8 lines changed or deleted 3 lines changed or added


 schroparse.h   schroparse.h 
#ifndef __SCHRO_PARSE_H__ #ifndef __SCHRO_PARSE_H__
#define __SCHRO_PARSE_H__ #define __SCHRO_PARSE_H__
#include <schroedinger/schrovideoformat.h> #include <schroedinger/schrovideoformat.h>
#include <schroedinger/schrobufferlist.h>
SCHRO_BEGIN_DECLS SCHRO_BEGIN_DECLS
int schro_parse_decode_sequence_header (uint8_t *data, int length, int schro_parse_decode_sequence_header (uint8_t *data, int length,
SchroVideoFormat *video_format); SchroVideoFormat *video_format);
#ifdef SCHRO_ENABLE_UNSTABLE_API
typedef struct _SchroParseSyncState SchroParseSyncState;
SchroParseSyncState *schro_parse_sync_new (void);
void schro_parse_sync_free (SchroParseSyncState *);
SchroBuffer *schro_parse_sync (SchroParseSyncState *sps, SchroBufferList *i
nput_bufer);
#endif
SCHRO_END_DECLS SCHRO_END_DECLS
#endif #endif
 End of changes. 2 change blocks. 
0 lines changed or deleted 12 lines changed or added


 schrophasecorrelation.h   schrophasecorrelation.h 
skipping to change at line 12 skipping to change at line 12
#ifndef __SCHRO_PHASECORRELATION_H__ #ifndef __SCHRO_PHASECORRELATION_H__
#define __SCHRO_PHASECORRELATION_H__ #define __SCHRO_PHASECORRELATION_H__
#include <schroedinger/schroencoder.h> #include <schroedinger/schroencoder.h>
#include <schroedinger/schromotionest.h> #include <schroedinger/schromotionest.h>
SCHRO_BEGIN_DECLS SCHRO_BEGIN_DECLS
#ifdef SCHRO_ENABLE_UNSTABLE_API #ifdef SCHRO_ENABLE_UNSTABLE_API
void schro_encoder_phasecorr_estimation (SchroMotionEst *me); typedef struct _SchroPhaseCorr SchroPhaseCorr;
typedef struct _SchroPhaseCorrLevel SchroPhaseCorrLevel;
struct _SchroPhaseCorrLevel {
int hshift;
int vshift;
int width;
int height;
int num_x;
int num_y;
int *vecs_dx;
int *vecs_dy;
int *vecs2_dx;
int *vecs2_dy;
};
struct _SchroPhaseCorr {
SchroEncoderFrame *frame;
SchroEncoderFrame *ref;
int shift;
int n;
int picture_shift;
int n_levels;
SchroPhaseCorrLevel levels[8];
/* static tables */
float *s, *c;
float *zero;
float *weight;
float *image1;
float *image2;
float *ft1r;
float *ft1i;
float *ft2r;
float *ft2i;
float *conv_r, *conv_i;
float *resr, *resi;
};
SchroPhaseCorr * schro_phasecorr_new (SchroEncoderFrame *frame,
SchroEncoderFrame *ref);
void schro_encoder_phasecorr_estimation (SchroPhaseCorr *pc);
void schro_phasecorr_free (SchroPhaseCorr *pc);
#endif #endif
SCHRO_END_DECLS SCHRO_END_DECLS
#endif #endif
 End of changes. 1 change blocks. 
1 lines changed or deleted 48 lines changed or added


 schrotables.h   schrotables.h 
skipping to change at line 15 skipping to change at line 15
#include <schroedinger/schroutils.h> #include <schroedinger/schroutils.h>
#include <schroedinger/schrobitstream.h> #include <schroedinger/schrobitstream.h>
SCHRO_BEGIN_DECLS SCHRO_BEGIN_DECLS
#ifdef SCHRO_ENABLE_UNSTABLE_API #ifdef SCHRO_ENABLE_UNSTABLE_API
extern const uint32_t schro_table_offset_3_8[61]; extern const uint32_t schro_table_offset_3_8[61];
extern const uint32_t schro_table_offset_1_2[61]; extern const uint32_t schro_table_offset_1_2[61];
extern const uint32_t schro_table_quant[61]; extern const uint32_t schro_table_quant[61];
extern const uint32_t schro_table_inverse_quant[61]; extern const uint16_t schro_table_inverse_quant[61];
extern const uint16_t schro_table_division_factor[257]; extern const uint16_t schro_table_division_factor[257];
extern const double schro_table_error_hist_shift3_1_2[60][104]; extern const double schro_table_error_hist_shift3_1_2[60][104];
extern const double schro_table_onebits_hist_shift3_1_2[60][104]; extern const double schro_table_onebits_hist_shift3_1_2[60][104];
extern const double schro_table_zerobits_hist_shift3_1_2[60][104]; extern const double schro_table_zerobits_hist_shift3_1_2[60][104];
extern const float schro_tables_wavelet_noise_curve[SCHRO_N_WAVELETS][8][12 8]; extern const float schro_tables_wavelet_noise_curve[SCHRO_N_WAVELETS][8][12 8];
extern const double schro_tables_wavelet_gain[SCHRO_N_WAVELETS][2]; extern const double schro_tables_wavelet_gain[SCHRO_N_WAVELETS][2];
extern const int schro_table_unpack_sint[256][17]; extern const int schro_table_unpack_sint[256][17];
void schro_tables_init (void);
int16_t *schro_tables_get_quantise_table (int quant_index, schro_bool is_in
tra);
int16_t *schro_tables_get_dequantise_table (int quant_index, schro_bool is_
intra);
#endif #endif
SCHRO_END_DECLS SCHRO_END_DECLS
#endif #endif
 End of changes. 2 change blocks. 
1 lines changed or deleted 7 lines changed or added


 schroutils.h   schroutils.h 
#ifndef __SCHRO_UTILS_H__ #ifndef __SCHRO_UTILS_H__
#define __SCHRO_UTILS_H__ #define __SCHRO_UTILS_H__
#include <schroedinger/schro-stdint.h> #if defined(_MSC_VER)
#ifndef SCHRO_NO_STDINT_TYPEDEFS
typedef __int8 int8_t;
typedef __int16 int16_t;
typedef __int32 int32_t;
typedef unsigned __int8 uint8_t;
typedef unsigned __int16 uint16_t;
typedef unsigned __int32 uint32_t;
#endif
#else
#include <stdint.h>
#endif
#ifndef TRUE #ifndef TRUE
#define TRUE 1 #define TRUE 1
#endif #endif
#ifndef FALSE #ifndef FALSE
#define FALSE 0 #define FALSE 0
#endif #endif
typedef uint32_t SchroPictureNumber; typedef uint32_t SchroPictureNumber;
typedef unsigned int schro_bool; typedef unsigned int schro_bool;
skipping to change at line 43 skipping to change at line 54
#endif #endif
#ifndef CLAMP #ifndef CLAMP
#define CLAMP(x,a,b) ((x)<(a) ? (a) : ((x)>(b) ? (b) : (x))) #define CLAMP(x,a,b) ((x)<(a) ? (a) : ((x)>(b) ? (b) : (x)))
#endif #endif
#define NEED_CLAMP(x,y,a,b) ((x) < (a) || (y) > (b)) #define NEED_CLAMP(x,y,a,b) ((x) < (a) || (y) > (b))
#define ROUND_UP_SHIFT(x,y) (((x) + (1<<(y)) - 1)>>(y)) #define ROUND_UP_SHIFT(x,y) (((x) + (1<<(y)) - 1)>>(y))
#define ROUND_UP_POW2(x,y) (((x) + (1<<(y)) - 1)&((~0)<<(y))) #define ROUND_UP_POW2(x,y) (((x) + (1<<(y)) - 1)&((~0)<<(y)))
#define ROUND_UP_2(x) ROUND_UP_POW2(x,1) #define ROUND_UP_2(x) ROUND_UP_POW2(x,1)
#define ROUND_UP_4(x) ROUND_UP_POW2(x,2) #define ROUND_UP_4(x) ROUND_UP_POW2(x,2)
#define ROUND_UP_8(x) ROUND_UP_POW2(x,3) #define ROUND_UP_8(x) ROUND_UP_POW2(x,3)
#define ROUND_UP_16(x) ROUND_UP_POW2(x,4)
#define ROUND_UP_64(x) ROUND_UP_POW2(x,6) #define ROUND_UP_64(x) ROUND_UP_POW2(x,6)
#define OFFSET(ptr,offset) ((void *)(((uint8_t *)(ptr)) + (offset))) #define OFFSET(ptr,offset) ((void *)(((uint8_t *)(ptr)) + (offset)))
#define ROUND_SHIFT(x,y) (((x) + (1<<((y)-1)))>>(y)) #define ROUND_SHIFT(x,y) (((x) + (1<<((y)-1)))>>(y))
#define schro_divide(a,b) (((a)<0)?(((a) - (b) + 1)/(b)):((a)/(b))) #define schro_divide(a,b) (((a)<0)?(((a) - (b) + 1)/(b)):((a)/(b)))
#define schro_divide3(a) (((a)*21845 + 10922)>>16)
#endif #endif
#define SCHRO_OFFSET(ptr,offset) ((void *)(((uint8_t *)(ptr)) + (offset))) #define SCHRO_OFFSET(ptr,offset) ((void *)(((uint8_t *)(ptr)) + (offset)))
#define SCHRO_GET(ptr, offset, type) (*(type *)((uint8_t *)(ptr) + (offset) ) ) #define SCHRO_GET(ptr, offset, type) (*(type *)((uint8_t *)(ptr) + (offset) ) )
#if defined(__GNUC__) && defined(__GNUC_MINOR__) #if defined(__GNUC__) && defined(__GNUC_MINOR__)
#define SCHRO_GNUC_PREREQ(maj, min) \ #define SCHRO_GNUC_PREREQ(maj, min) \
((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
#else #else
#define SCHRO_GNUC_PREREQ(maj, min) 0 #define SCHRO_GNUC_PREREQ(maj, min) 0
#endif #endif
#if SCHRO_GNUC_PREREQ(3,3) && defined(__ELF__) #if SCHRO_GNUC_PREREQ(3,3) && defined(__ELF__)
#define SCHRO_INTERNAL __attribute__ ((visibility ("internal"))) #define SCHRO_INTERNAL __attribute__ ((visibility ("internal")))
#else #else
#define SCHRO_INTERNAL #define SCHRO_INTERNAL
#endif #endif
#if SCHRO_GNUC_PREREQ(3,3)
#define SCHRO_DEPRECATED __attribute__ ((deprecated))
#else
#define SCHRO_DEPRECATED
#endif
#ifdef __cplusplus #ifdef __cplusplus
#define SCHRO_BEGIN_DECLS extern "C" { #define SCHRO_BEGIN_DECLS extern "C" {
#define SCHRO_END_DECLS } #define SCHRO_END_DECLS }
#else #else
#define SCHRO_BEGIN_DECLS #define SCHRO_BEGIN_DECLS
#define SCHRO_END_DECLS #define SCHRO_END_DECLS
#endif #endif
SCHRO_BEGIN_DECLS SCHRO_BEGIN_DECLS
skipping to change at line 90 skipping to change at line 109
void * schro_malloc0 (int size); void * schro_malloc0 (int size);
void * schro_realloc (void *ptr, int size); void * schro_realloc (void *ptr, int size);
void schro_free (void *ptr); void schro_free (void *ptr);
int muldiv64 (int a, int b, int c); int muldiv64 (int a, int b, int c);
int schro_utils_multiplier_to_quant_index (double x); int schro_utils_multiplier_to_quant_index (double x);
int schro_dequantise (int q, int quant_factor, int quant_offset); int schro_dequantise (int q, int quant_factor, int quant_offset);
int schro_quantise (int value, int quant_factor, int quant_offset); int schro_quantise (int value, int quant_factor, int quant_offset);
void schro_quantise_s16 (int16_t *dest, int16_t *src, int quant_factor, void schro_quantise_s16 (int16_t *dest, int16_t *src, int quant_factor,
int quant_offset, int n); int quant_offset, int n);
void schro_quantise_s16_table (int16_t *dest, int16_t *src, int quant_index
,
schro_bool is_intra, int n);
void schro_dequantise_s16 (int16_t *dest, int16_t *src, int quant_factor, void schro_dequantise_s16 (int16_t *dest, int16_t *src, int quant_factor,
int quant_offset, int n); int quant_offset, int n);
void schro_dequantise_s16_table (int16_t *dest, int16_t *src, int quant_ind
ex,
schro_bool is_intra, int n);
double schro_utils_probability_to_entropy (double x); double schro_utils_probability_to_entropy (double x);
double schro_utils_entropy (double a, double total); double schro_utils_entropy (double a, double total);
void schro_utils_reduce_fraction (int *n, int *d); void schro_utils_reduce_fraction (int *n, int *d);
double schro_utils_get_time (void); double schro_utils_get_time (void);
#endif #endif
SCHRO_END_DECLS SCHRO_END_DECLS
#endif #endif
 End of changes. 6 change blocks. 
1 lines changed or deleted 26 lines changed or added


 schrovideoformat.h   schrovideoformat.h 
skipping to change at line 71 skipping to change at line 71
SchroColourSpec schro_video_format_get_std_colour_spec (SchroVideoFormat *f ormat); SchroColourSpec schro_video_format_get_std_colour_spec (SchroVideoFormat *f ormat);
#ifdef SCHRO_ENABLE_UNSTABLE_API #ifdef SCHRO_ENABLE_UNSTABLE_API
int schro_video_format_get_picture_height (SchroVideoFormat *format); int schro_video_format_get_picture_height (SchroVideoFormat *format);
void schro_video_format_get_picture_luma_size (SchroVideoFormat *format, void schro_video_format_get_picture_luma_size (SchroVideoFormat *format,
int *picture_luma_width, int *picture_luma_height); int *picture_luma_width, int *picture_luma_height);
void schro_video_format_get_picture_chroma_size (SchroVideoFormat *format, void schro_video_format_get_picture_chroma_size (SchroVideoFormat *format,
int *picture_chroma_width, int *picture_chroma_height); int *picture_chroma_width, int *picture_chroma_height);
void schro_video_format_get_iwt_alloc_size (SchroVideoFormat *format, void schro_video_format_get_iwt_alloc_size (SchroVideoFormat *format,
int *width, int *height); int *width, int *height, int transform_depth);
int schro_video_format_get_bit_depth (SchroVideoFormat *format); int schro_video_format_get_bit_depth (SchroVideoFormat *format);
schro_bool schro_video_format_check_MP_DL (SchroVideoFormat *format);
schro_bool schro_video_format_check_VC2_DL (SchroVideoFormat *format);
int schro_video_format_compare_new_sequence (SchroVideoFormat *a, SchroVide
oFormat *b);
int schro_video_format_compare (SchroVideoFormat *a, SchroVideoFormat *b);
#endif #endif
SCHRO_END_DECLS SCHRO_END_DECLS
#endif #endif
 End of changes. 2 change blocks. 
1 lines changed or deleted 6 lines changed or added


 schrovirtframe.h   schrovirtframe.h 
#ifndef __SCHRO_VIRT_FRAME_H__ #ifndef __SCHRO_VIRT_FRAME_H__
#define __SCHRO_VIRT_FRAME_H__ #define __SCHRO_VIRT_FRAME_H__
#include <schroedinger/schroutils.h> #include <schroedinger/schroutils.h>
#include <schroedinger/schroframe.h> #include <schroedinger/schroframe.h>
SCHRO_BEGIN_DECLS SCHRO_BEGIN_DECLS
#ifdef SCHRO_ENABLE_UNSTABLE_API
SchroFrame *schro_frame_new_virtual (SchroMemoryDomain *domain, SchroFrame *schro_frame_new_virtual (SchroMemoryDomain *domain,
SchroFrameFormat format, int width, int height); SchroFrameFormat format, int width, int height);
void *schro_virt_frame_get_line (SchroFrame *frame, int component, int i); void *schro_virt_frame_get_line (SchroFrame *frame, int component, int i);
void schro_virt_frame_render_line (SchroFrame *frame, void *dest, void schro_virt_frame_render_line (SchroFrame *frame, void *dest,
int component, int i); int component, int i);
void schro_virt_frame_render (SchroFrame *frame, SchroFrame *dest); void schro_virt_frame_render (SchroFrame *frame, SchroFrame *dest);
SchroFrame *schro_virt_frame_new_horiz_downsample (SchroFrame *vf); SchroFrame *schro_virt_frame_new_horiz_downsample (SchroFrame *vf, int cosi
SchroFrame *schro_virt_frame_new_vert_downsample (SchroFrame *vf); te);
SchroFrame *schro_virt_frame_new_vert_downsample (SchroFrame *vf, int cosit
e);
SchroFrame *schro_virt_frame_new_vert_resample (SchroFrame *vf, int height)
;
SchroFrame *schro_virt_frame_new_horiz_resample (SchroFrame *vf, int width)
;
SchroFrame *schro_virt_frame_new_unpack (SchroFrame *vf); SchroFrame *schro_virt_frame_new_unpack (SchroFrame *vf);
SchroFrame *schro_virt_frame_new_pack_YUY2 (SchroFrame *vf); SchroFrame *schro_virt_frame_new_pack_YUY2 (SchroFrame *vf);
SchroFrame *schro_virt_frame_new_pack_UYVY (SchroFrame *vf); SchroFrame *schro_virt_frame_new_pack_UYVY (SchroFrame *vf);
SchroFrame *schro_virt_frame_new_pack_AYUV (SchroFrame *vf); SchroFrame *schro_virt_frame_new_pack_AYUV (SchroFrame *vf);
SchroFrame *schro_virt_frame_new_pack_v216 (SchroFrame *vf);
SchroFrame *schro_virt_frame_new_pack_v210 (SchroFrame *vf);
SchroFrame *schro_virt_frame_new_pack_RGB (SchroFrame *vf);
SchroFrame *schro_virt_frame_new_color_matrix (SchroFrame *vf);
SchroFrame *schro_virt_frame_new_subsample (SchroFrame *vf, SchroFrameForma
t format);
SchroFrame * schro_virt_frame_new_convert_u8 (SchroFrame *vf);
SchroFrame * schro_virt_frame_new_convert_s16 (SchroFrame *vf);
SchroFrame * schro_virt_frame_new_crop (SchroFrame *vf, int width, int heig
ht);
SchroFrame * schro_virt_frame_new_edgeextend (SchroFrame *vf, int width, in
t height);
SchroFrame * schro_virt_frame_new_interlace (SchroFrame *vf_top, SchroFrame
*vf_bottom);
#endif
SCHRO_END_DECLS SCHRO_END_DECLS
#endif #endif
 End of changes. 3 change blocks. 
2 lines changed or deleted 27 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/