diff options
Diffstat (limited to 'source/blender/imbuf/intern')
-rw-r--r-- | source/blender/imbuf/intern/IMB_indexer.h | 34 | ||||
-rw-r--r-- | source/blender/imbuf/intern/anim_movie.c | 48 | ||||
-rw-r--r-- | source/blender/imbuf/intern/indexer.c | 54 | ||||
-rw-r--r-- | source/blender/imbuf/intern/jpeg.c | 11 | ||||
-rw-r--r-- | source/blender/imbuf/intern/png.c | 25 | ||||
-rw-r--r-- | source/blender/imbuf/intern/scaling.c | 18 | ||||
-rw-r--r-- | source/blender/imbuf/intern/thumbs_blend.c | 2 |
7 files changed, 98 insertions, 94 deletions
diff --git a/source/blender/imbuf/intern/IMB_indexer.h b/source/blender/imbuf/intern/IMB_indexer.h index 5c76f33a319..9ce587aa983 100644 --- a/source/blender/imbuf/intern/IMB_indexer.h +++ b/source/blender/imbuf/intern/IMB_indexer.h @@ -78,24 +78,26 @@ typedef struct anim_index_builder { void * private_data; void (*delete_priv_data)(struct anim_index_builder * idx); - void (*proc_frame)(struct anim_index_builder * idx, - unsigned char * buffer, - int data_size, - struct anim_index_entry * entry); + void (*proc_frame)(struct anim_index_builder * idx, + unsigned char * buffer, + int data_size, + struct anim_index_entry * entry); } anim_index_builder; anim_index_builder * IMB_index_builder_create(const char * name); -void IMB_index_builder_add_entry(anim_index_builder * fp, - int frameno, unsigned long long seek_pos, - unsigned long long seek_pos_dts, - unsigned long long pts); - -void IMB_index_builder_proc_frame(anim_index_builder * fp, - unsigned char * buffer, - int data_size, - int frameno, unsigned long long seek_pos, - unsigned long long seek_pos_dts, - unsigned long long pts); +void IMB_index_builder_add_entry( + anim_index_builder * fp, + int frameno, unsigned long long seek_pos, + unsigned long long seek_pos_dts, + unsigned long long pts); + +void IMB_index_builder_proc_frame( + anim_index_builder * fp, + unsigned char * buffer, + int data_size, + int frameno, unsigned long long seek_pos, + unsigned long long seek_pos_dts, + unsigned long long pts); void IMB_index_builder_finish(anim_index_builder * fp, int rollback); @@ -111,7 +113,7 @@ unsigned long long IMB_indexer_get_pts(struct anim_index * idx, int IMB_indexer_get_duration(struct anim_index * idx); int IMB_indexer_can_scan(struct anim_index * idx, - int old_frame_index, int new_frame_index); + int old_frame_index, int new_frame_index); void IMB_indexer_close(struct anim_index * idx); diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c index 09b79e51648..fb6c85c2408 100644 --- a/source/blender/imbuf/intern/anim_movie.c +++ b/source/blender/imbuf/intern/anim_movie.c @@ -530,12 +530,12 @@ static int startffmpeg(struct anim * anim) { } if (anim->ib_flags & IB_animdeinterlace) { - avpicture_fill((AVPicture*) anim->pFrameDeinterlaced, - MEM_callocN(avpicture_get_size( - anim->pCodecCtx->pix_fmt, - anim->x, anim->y), - "ffmpeg deinterlace"), - anim->pCodecCtx->pix_fmt, anim->x, anim->y); + avpicture_fill((AVPicture*) anim->pFrameDeinterlaced, + MEM_callocN(avpicture_get_size( + anim->pCodecCtx->pix_fmt, + anim->x, anim->y), + "ffmpeg deinterlace"), + anim->pCodecCtx->pix_fmt, anim->x, anim->y); } if (pCodecCtx->has_b_frames) { @@ -627,9 +627,9 @@ static void ffmpeg_postprocess(struct anim * anim) } } - avpicture_fill((AVPicture*) anim->pFrameRGB, - (unsigned char*) ibuf->rect, - PIX_FMT_RGBA, anim->x, anim->y); + avpicture_fill((AVPicture*) anim->pFrameRGB, + (unsigned char*) ibuf->rect, + PIX_FMT_RGBA, anim->x, anim->y); if (ENDIAN_ORDER == B_ENDIAN) { int * dstStride = anim->pFrameRGB->linesize; @@ -641,12 +641,12 @@ static void ffmpeg_postprocess(struct anim * anim) unsigned char* top; sws_scale(anim->img_convert_ctx, - (const uint8_t * const *)input->data, - input->linesize, - 0, - anim->pCodecCtx->height, - dst2, - dstStride2); + (const uint8_t * const *)input->data, + input->linesize, + 0, + anim->pCodecCtx->height, + dst2, + dstStride2); /* workaround: sws_scale bug sets alpha = 0 and compensate @@ -691,12 +691,12 @@ static void ffmpeg_postprocess(struct anim * anim) unsigned char* r; sws_scale(anim->img_convert_ctx, - (const uint8_t * const *)input->data, - input->linesize, - 0, - anim->pCodecCtx->height, - dst2, - dstStride2); + (const uint8_t * const *)input->data, + input->linesize, + 0, + anim->pCodecCtx->height, + dst2, + dstStride2); r = (unsigned char*) ibuf->rect; @@ -1024,10 +1024,10 @@ static ImBuf * ffmpeg_fetchibuf(struct anim * anim, int position, } if (ret < 0) { - av_log(anim->pFormatCtx, AV_LOG_ERROR, + av_log(anim->pFormatCtx, AV_LOG_ERROR, "FETCH: " "error while seeking to DTS = %lld " - "(frameno = %d, PTS = %lld): errcode = %d\n", + "(frameno = %d, PTS = %lld): errcode = %d\n", pos, position, (long long int)pts_to_search, ret); } @@ -1125,7 +1125,7 @@ static ImBuf * redcode_fetchibuf(struct anim * anim, int position) { } ibuf = IMB_allocImBuf(raw_frame->width * 2, - raw_frame->height * 2, 32, IB_rectfloat); + raw_frame->height * 2, 32, IB_rectfloat); redcode_decode_video_float(raw_frame, ibuf->rect_float, 1); diff --git a/source/blender/imbuf/intern/indexer.c b/source/blender/imbuf/intern/indexer.c index 3a94c79f48d..9993df61089 100644 --- a/source/blender/imbuf/intern/indexer.c +++ b/source/blender/imbuf/intern/indexer.c @@ -48,12 +48,12 @@ static char magic[] = "BlenMIdx"; static char temp_ext [] = "_part"; static int proxy_sizes[] = { IMB_PROXY_25, IMB_PROXY_50, IMB_PROXY_75, - IMB_PROXY_100 }; + IMB_PROXY_100 }; static float proxy_fac[] = { 0.25, 0.50, 0.75, 1.00 }; #ifdef WITH_FFMPEG static int tc_types[] = { IMB_TC_RECORD_RUN, IMB_TC_FREE_RUN, - IMB_TC_INTERPOLATED_REC_DATE_FREE_RUN }; + IMB_TC_INTERPOLATED_REC_DATE_FREE_RUN }; #endif #define INDEX_FILE_VERSION 1 @@ -73,9 +73,9 @@ extern void IMB_indexer_dv_new(anim_index_builder * idx); anim_index_builder * IMB_index_builder_create(const char * name) { - anim_index_builder * rv - = MEM_callocN( sizeof(struct anim_index_builder), - "index builder"); + anim_index_builder * rv + = MEM_callocN( sizeof(struct anim_index_builder), + "index builder"); fprintf(stderr, "Starting work on index: %s\n", name); @@ -197,13 +197,13 @@ struct anim_index * IMB_indexer_open(const char * name) * idx->num_entries, "anim_index_entries"); for (i = 0; i < idx->num_entries; i++) { - fread(&idx->entries[i].frameno, + fread(&idx->entries[i].frameno, sizeof(int), 1, fp); - fread(&idx->entries[i].seek_pos, + fread(&idx->entries[i].seek_pos, sizeof(unsigned long long), 1, fp); - fread(&idx->entries[i].seek_pos_dts, + fread(&idx->entries[i].seek_pos_dts, sizeof(unsigned long long), 1, fp); - fread(&idx->entries[i].pts, + fread(&idx->entries[i].pts, sizeof(unsigned long long), 1, fp); } @@ -392,7 +392,7 @@ static void get_proxy_filename(struct anim * anim, IMB_Proxy_Size preview_size, get_index_dir(anim, index_dir); BLI_join_dirfile(fname, FILE_MAXFILE + FILE_MAXDIR, index_dir, - temp ? proxy_temp_name : proxy_name); + temp ? proxy_temp_name : proxy_name); } static void get_tc_filename(struct anim * anim, IMB_Timecode_Type tc, @@ -418,7 +418,7 @@ static void get_tc_filename(struct anim * anim, IMB_Timecode_Type tc, get_index_dir(anim, index_dir); BLI_join_dirfile(fname, FILE_MAXFILE + FILE_MAXDIR, - index_dir, index_name); + index_dir, index_name); } /* ---------------------------------------------------------------------- @@ -533,15 +533,16 @@ static struct proxy_output_ctx * alloc_proxy_output_ffmpeg( rv->orig_height = st->codec->height; - if (st->codec->width != width || st->codec->height != height - || st->codec->pix_fmt != rv->c->pix_fmt) { + if (st->codec->width != width || st->codec->height != height || + st->codec->pix_fmt != rv->c->pix_fmt) + { rv->frame = avcodec_alloc_frame(); - avpicture_fill((AVPicture*) rv->frame, - MEM_mallocN(avpicture_get_size( - rv->c->pix_fmt, - round_up(width, 16), height), - "alloc proxy output frame"), - rv->c->pix_fmt, round_up(width, 16), height); + avpicture_fill((AVPicture*) rv->frame, + MEM_mallocN(avpicture_get_size( + rv->c->pix_fmt, + round_up(width, 16), height), + "alloc proxy output frame"), + rv->c->pix_fmt, round_up(width, 16), height); rv->sws_ctx = sws_getContext( st->codec->width, @@ -567,12 +568,13 @@ static int add_to_proxy_output_ffmpeg( return 0; } - if (ctx->sws_ctx && frame && - (frame->data[0] || frame->data[1] || - frame->data[2] || frame->data[3])) { + if ( ctx->sws_ctx && frame && + (frame->data[0] || frame->data[1] || + frame->data[2] || frame->data[3])) + { sws_scale(ctx->sws_ctx, (const uint8_t * const*) frame->data, - frame->linesize, 0, ctx->orig_height, - ctx->frame->data, ctx->frame->linesize); + frame->linesize, 0, ctx->orig_height, + ctx->frame->data, ctx->frame->linesize); } frame = ctx->sws_ctx ? (frame ? ctx->frame : 0) : frame; @@ -664,13 +666,13 @@ static void free_proxy_output_ffmpeg(struct proxy_output_ctx * ctx, } get_proxy_filename(ctx->anim, ctx->proxy_size, - fname_tmp, TRUE); + fname_tmp, TRUE); if (rollback) { unlink(fname_tmp); } else { get_proxy_filename(ctx->anim, ctx->proxy_size, - fname, FALSE); + fname, FALSE); rename(fname_tmp, fname); } diff --git a/source/blender/imbuf/intern/jpeg.c b/source/blender/imbuf/intern/jpeg.c index d9bd0b9cda4..89038d7d1d2 100644 --- a/source/blender/imbuf/intern/jpeg.c +++ b/source/blender/imbuf/intern/jpeg.c @@ -219,14 +219,13 @@ static void memory_source(j_decompress_ptr cinfo, unsigned char *buffer, size_t * Note we do *not* do INPUT_SYNC before calling fill_input_buffer, * but we must reload the local copies after a successful fill. */ -#define MAKE_BYTE_AVAIL(cinfo,action) \ - if (bytes_in_buffer == 0) { \ - if (! (*datasrc->fill_input_buffer) (cinfo)) \ - { action; } \ - INPUT_RELOAD(cinfo); \ +#define MAKE_BYTE_AVAIL(cinfo, action) \ + if (bytes_in_buffer == 0) { \ + if (! (*datasrc->fill_input_buffer) (cinfo)) \ + { action; } \ + INPUT_RELOAD(cinfo); \ } - /* Read a byte into variable V. * If must suspend, take the specified action (typically "return FALSE"). diff --git a/source/blender/imbuf/intern/png.c b/source/blender/imbuf/intern/png.c index 13c381ae9c4..be245baef21 100644 --- a/source/blender/imbuf/intern/png.c +++ b/source/blender/imbuf/intern/png.c @@ -190,10 +190,11 @@ int imb_savepng(struct ImBuf *ibuf, const char *name, int flags) ibuf->encodedsize = 0; png_set_write_fn(png_ptr, - (png_voidp) ibuf, - WriteData, - Flush); - } else { + (png_voidp) ibuf, + WriteData, + Flush); + } + else { fp = fopen(name, "wb"); if (!fp) { png_destroy_write_struct(&png_ptr, &info_ptr); @@ -218,14 +219,14 @@ int imb_savepng(struct ImBuf *ibuf, const char *name, int flags) // png image settings png_set_IHDR(png_ptr, - info_ptr, - ibuf->x, - ibuf->y, - 8, - color_type, - PNG_INTERLACE_NONE, - PNG_COMPRESSION_TYPE_DEFAULT, - PNG_FILTER_TYPE_DEFAULT); + info_ptr, + ibuf->x, + ibuf->y, + 8, + color_type, + PNG_INTERLACE_NONE, + PNG_COMPRESSION_TYPE_DEFAULT, + PNG_FILTER_TYPE_DEFAULT); /* image text info */ if (ibuf->metadata) { diff --git a/source/blender/imbuf/intern/scaling.c b/source/blender/imbuf/intern/scaling.c index fe53a883f82..6519e389a21 100644 --- a/source/blender/imbuf/intern/scaling.c +++ b/source/blender/imbuf/intern/scaling.c @@ -539,7 +539,7 @@ static void shrink_picture_byte( *dst++ = (val= (dst_line1[x].a * f) >> 15) > 255 ? 255: val; } memset(dst_line1, 0, dst_width * - sizeof(struct scale_outpix_byte)); + sizeof(struct scale_outpix_byte)); temp = dst_line1; dst_line1 = dst_line2; dst_line2 = temp; @@ -740,7 +740,7 @@ static void shrink_picture_float( *dst++ = dst_line1[x].a * f; } memset(dst_line1, 0, dst_width * - sizeof(struct scale_outpix_float)); + sizeof(struct scale_outpix_float)); temp = dst_line1; dst_line1 = dst_line2; dst_line2 = temp; @@ -803,21 +803,21 @@ static int q_scale_linear_interpolation( } if (ibuf->rect) { - unsigned char * newrect = - MEM_mallocN(newx * newy * sizeof(int), "q_scale rect"); + unsigned char * newrect = + MEM_mallocN(newx * newy * sizeof(int), "q_scale rect"); q_scale_byte((unsigned char *)ibuf->rect, newrect, ibuf->x, ibuf->y, - newx, newy); + newx, newy); imb_freerectImBuf(ibuf); ibuf->mall |= IB_rect; ibuf->rect = (unsigned int *) newrect; } if (ibuf->rect_float) { - float * newrect = - MEM_mallocN(newx * newy * 4 *sizeof(float), - "q_scale rectfloat"); + float * newrect = + MEM_mallocN(newx * newy * 4 *sizeof(float), + "q_scale rectfloat"); q_scale_float(ibuf->rect_float, newrect, ibuf->x, ibuf->y, - newx, newy); + newx, newy); imb_freerectfloatImBuf(ibuf); ibuf->mall |= IB_rectfloat; ibuf->rect_float = newrect; diff --git a/source/blender/imbuf/intern/thumbs_blend.c b/source/blender/imbuf/intern/thumbs_blend.c index 0eaa87542d5..149b5fb9096 100644 --- a/source/blender/imbuf/intern/thumbs_blend.c +++ b/source/blender/imbuf/intern/thumbs_blend.c @@ -64,7 +64,7 @@ static ImBuf *loadblend_thumb(gzFile gzfile) else return NULL; - sizeof_bhead = 16 + pointer_size; + sizeof_bhead = 16 + pointer_size; if(buf[8]=='V') endian= B_ENDIAN; /* big: PPC */ |