Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
static int rd_frame(CinepakEncContext *s, const AVFrame *frame, int isakeyframe, unsigned char *buf, int buf_size)
{
static int rd_frame(CinepakEncContext *s, const AVFrame *frame, int isakeyframe, unsigned char *buf, int buf_size)
{
- int num_strips, strip, i, y, nexty, size, temp_size, best_size;
+ int num_strips, strip, i, y, nexty, size, temp_size;
AVPicture last_pict, pict, scratch_pict;
int64_t best_score = 0, score, score_temp;
#ifdef CINEPAK_REPORT_SERR
int64_t best_serr = 0, serr, serr_temp;
#endif
AVPicture last_pict, pict, scratch_pict;
int64_t best_score = 0, score, score_temp;
#ifdef CINEPAK_REPORT_SERR
int64_t best_serr = 0, serr, serr_temp;
#endif
+ int best_nstrips = -1, best_size = -1; // mark as uninitialzed
if(s->pix_fmt == AV_PIX_FMT_RGB24) {
int x;
if(s->pix_fmt == AV_PIX_FMT_RGB24) {
int x;
+ av_assert0(best_nstrips >= 0 && best_size >= 0);
+
// let the number of strips slowly adapt to the changes in the contents,
// compared to full bruteforcing every time this will occasionally lead
// to some r/d performance loss but makes encoding up to several times faster
// let the number of strips slowly adapt to the changes in the contents,
// compared to full bruteforcing every time this will occasionally lead
// to some r/d performance loss but makes encoding up to several times faster