Commit Graph

1129 Commits

Author SHA1 Message Date
Sergey Sharybin 74e32efbc8 Fix wrong memory write in partial render update with Save Buffers enabled
No idea why this issue hasn't been spotted before. Took several hours to
figure out where exactly wrong memory access happens..

P.S. I really want to switch ImBuf->rect from int* to unsigned char*...
2014-06-10 17:10:37 +06:00
Sergey Sharybin 615f4dc92f Fix T40547: Can't read single channel EXRs
The root of the issue goes to the fact that we only can
read RGB EXR files, but they could be YCbCr or just Luma.
Added support for this two cases.

Note: internally EXR would still be 3 channels, so no
big memory save would happen here, at least yet.
2014-06-09 16:43:08 +06:00
Sergey Sharybin 973f95fa9d Fix T40157: Loading movies larger than 4GB in size fails
Issue was caused by _wstat returning EOVERFLOW error because
of file size didn't fit into stat structure which was using
long datatype.

The idea of this patch is to use _wstat64 and _stat64 structure
which is capable storing 64bit file sizes.

Made it a typedef for stat structure used by BLI_stat function
in order to make code easier to follow and avoid ifdefs all
over the place.

Additionally solved issue with BLI_exists which was wrongly
returning False in cases destination file is larger then 4GB.
2014-05-28 23:21:39 +06:00
Sergey Sharybin 56b7d55833 Report to the console when custom ocio config is used 2014-05-23 13:48:35 +02:00
Campbell Barton 48881ad1e0 Code cleanup: doxy comments 2014-05-14 15:00:47 +10:00
Dalai Felinto 8904eaf504 Fix T40107: painting on a psd image crashes blender + style cleanup in file
The issue was that we can't assume we support the colorspace from the file. The reported file had an invalid colorspace in fact, which was leading to the segfault in Blender.

Thanks for Sergey Sharybin for the help here.
2014-05-10 10:58:48 -03:00
Dalai Felinto 3312b20ac8 IMB buffer functions to take a mask as input
The mask make sure the conversion only happens in a few areas of the
buffer.

New Functions:
* IMB_buffer_byte_from_float_mask
* IMB_buffer_float_from_float_mask

The functions are an adaptation of their maskless counterparts without accepting different profiles for the input and output buffers.

Review: Sergey Sharybin
2014-05-02 20:56:16 -03:00
Campbell Barton fa25d7cf7b Code cleanup: remove defines no longer needed on windows 2014-05-02 00:55:54 +10:00
Thomas Dinges 55b2a5aa45 More fixes, msvc 2008 needs math includes for "isnan".. 2014-05-01 00:36:15 +02:00
Campbell Barton af86b008b2 Include removal gave problems with windows, ifdef some back in for windows only 2014-05-01 07:21:08 +10:00
Campbell Barton cb48c0ceea Revert "Fix msvc 2013 compiler errors after the ingenious cleanup in 4ca67869cc7a."
This reverts commit a47a4ef82f.
2014-05-01 07:20:46 +10:00
Thomas Dinges a47a4ef82f Fix msvc 2013 compiler errors after the ingenious cleanup in 4ca67869cc. 2014-04-30 23:16:12 +02:00
Campbell Barton 4ca67869cc Code cleanup: remove unused includes
Opted to keep includes if they are used indirectly (even if removing is possible).
2014-05-01 04:47:51 +10:00
Campbell Barton d2032d0dfe Fix T39931: Crash generating thumbnails (error in escaping) 2014-04-30 20:44:52 +10:00
Sergey Sharybin fe29f92030 Fix T39953: Float data images display trash in image editor
Was a failure of optimization trick.
2014-04-30 16:26:20 +06:00
Campbell Barton 863352dfdc Correct issue with IMB_ispic returning bool 2014-04-30 10:43:46 +10:00
Campbell Barton b6e967be63 Code cleanup: const args and arrays 2014-04-27 08:56:54 +10:00
Campbell Barton 7ca74fc1c0 Code cleanup: use 'const' for arrays (blenloader, gpu, imbuf, makesdna, modifiers, nodes) 2014-04-27 00:25:16 +10:00
Campbell Barton 551096d6fd BLI_open: check returned value for -1 instead of < 0 2014-04-22 16:40:17 +10:00
Campbell Barton a15b3c4d11 Code cleanup: use bool 2014-04-11 11:33:29 +10:00
Campbell Barton 412826a504 Mempool: delay allocating an initial chunk, its not always used 2014-04-08 12:58:56 +10:00
Antonis Ryakiotakis aabf4154e5 Fix building for Windows. 2014-04-07 04:18:03 +03:00
Campbell Barton be8b4b8b0c Todo T36849: support XDG thumbnail management standard 2014-04-07 08:43:46 +10:00
Campbell Barton af59ee340f Mempool: remove BLI_MEMPOOL_SYSMALLOC, MEM_* allocs are more efficient now 2014-04-05 12:14:05 +11:00
Bastien Montagne 35747ee3d5 Rename "BLI_cpu.h" to "BLI_system.h" and add to it BLI_getpid() helper.
There is not much sense to have a whole BLI file just to check SSE2 on CPUs...
So idea is to rename it to more generic "BLI_system", and add to it more system-related
utils, like e.g. an include helper for getpid(), which allows to hide unix/windows
internals from rest of the code...

Reviewers: campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D439
2014-04-02 11:59:43 +02:00
Sergey Sharybin ee72cba008 Fix T39446: Blender Crashes when Camera Tracking
Issue is likely caused by thread-unsafe nature of IMB_freeImBuf
which might lead to race condition in some circumstances.

Now made it thread-safe and from Sebastian's tests seems crash is
gone now, so hopefully the root of the issue is finally nailed down.
2014-04-01 13:14:37 +06:00
Campbell Barton 617557b08e Code cleanup: remove TRUE/FALSE & WITH_BOOL_COMPAT define 2014-04-01 15:22:28 +11:00
Sergey Sharybin f88776bb5c Fix T39410: Crashes when Saving HiRes .tif 2014-03-28 15:22:10 +06:00
Sergey Sharybin 6452d9f02f Fix T39395: Switching to "Textured solid" and "GLSL" view will cause the FPS drop to 0
Issue was caused by the cache limitor which was removing 4k textures from the
memory when accessing other images.

This is pretty much awful situation and solved by making it so only image sequences
and movies ace cache-guarded.

Could be optimized further so images used by viewport are not being freed, but
that's much more tricky to do..

This is a nice candidature for 'a'.
2014-03-25 12:30:41 +06:00
Sergey Sharybin 77c1d17940 Fix T39186: Matroska audio support (mka, mkv without video stream)
.mka files were considered image files when adding to sequencer
using drag-n-drop.
2014-03-21 13:52:37 +06:00
Campbell Barton a91247c2b4 Code cleanup: unreachable break/return 2014-03-19 12:47:09 +11:00
Juergen Herrmann 5559302369 Cleanup some useless/unneeded #ifdefs for MSVC2013. 2014-03-09 00:25:08 +01:00
Sergey Sharybin 4ce7d5cb79 Fixes for proxies color space
Basically proxy colorspace didn't work well enough.

It is still a bit weird and mainly:

- Proxies for image sequences are built in the image color space.

- Proxies for movies are built in the movie color space.

This could be unified but would need some work in proxy build
to make it not just pipe frames from one FFmpeg context to
another but also apply OCIO on it.
2014-03-06 17:32:45 +06:00
Campbell Barton 9737717234 Fix for some unlikely memory leaks, remove redundant checks 2014-03-01 20:14:20 +11:00
Campbell Barton 20da9353b8 Code cleanup: unused/warnings 2014-02-17 11:34:12 +11:00
Campbell Barton 5621e63d36 Code cleanup: duplicate headers 2014-02-14 10:55:38 +11:00
Campbell Barton b3afbcab8f ListBase API: add utility api funcs for clearing and checking empty 2014-02-08 06:24:05 +11:00
Sergey Sharybin 4f40f8780d Remove unnecessary debug print 2014-02-06 15:31:54 +06:00
Campbell Barton 37026b12ec Code cleanup: use bool for static methods 2014-02-05 22:36:15 +11:00
Sergey Sharybin 9bec4f7779 Fix T38455: Blenderplayer is not working
Was a regression since avg_frame_rate changes.

Didn't find reliable way to get stream duration which will
work with both FFmpeg and Libav so added some freaking black
magic to distinguish one from another.
2014-02-03 17:25:47 +06:00
Campbell Barton b783140ef6 Image/Animation loading, remove user-pref extension check.
don't use extension checking preference for low level loading functions,
otherwise a user preference may impact a script loading a file for example.

looked into making this an argument and passing it in, but theres no
real advantage and its simpler just to remove.
2014-02-03 19:37:40 +11:00
Campbell Barton d900f5be55 Code cleanup: use bools where possible 2014-02-03 19:35:44 +11:00
Campbell Barton 3c86a1932f Code cleanup: add BLI_testextensie_n, replacing multuple calls to BLI_testextensie
also use attributes for BLI path functions
2014-01-31 03:30:05 +11:00
Anton Khirnov f99e581ae1 libavformat API usage: use avformat_close_input() instead of av_close_input_file() 2014-01-28 14:20:22 +06:00
Anton Khirnov 414e40c353 libavformat API usage: use avg_frame_rate instead of r_frame_rate
r_frame_rate is a guessed number defined as "the least common multiple of
all framerates in the stream". It has been deprecated and removed in new
Libav releases.

Use avg_frame_rate instead, which is the average framerate of the
stream.
2014-01-28 14:18:41 +06:00
Anton Khirnov b7f8bfef25 libavcodec API usage: use new video encoding API
avcodec_encode_video() has been replaced with avcodec_encode_video2()
in new libavcodec versions.
2014-01-28 14:17:50 +06:00
Anton Khirnov 8c3b27ce27 Change libavcodec CODEC_ID_* to AV_CODEC_ID_*
CODEC_ID_* have been replaced with AV_CODEC_ID_* in new libavcodec
versions.

Update the code to use those new identifiers.

Added a compatibility code to ffmpeg_compat.h
2014-01-28 14:00:31 +06:00
Brecht Van Lommel 70e844ea11 Fix T38353: some EXR files from other applications not loading correctly.
* EXR layers with names like 'Z' without any pass name were not loaded at all
  and would break the Combined pass as well.
* EXR pass names longer than 16 characters where writing past the end of the
  array and getting invalid names.
2014-01-25 17:44:15 +01:00
Sergey Sharybin 898498c800 Fix for IMB_(un)premultiply_rect_float() not doing right business
- Made them receive number of channels rather than number of planes.
  This matches to how ImBuf structure stored planes and channels.
- IMB_premultiply_rect_float() was called with channels passed instead
  of planes already :S.
2014-01-23 16:51:32 +06:00
Brecht Van Lommel 94325035f4 Fix T38298: crash saving float image with 3 channels from exr to png/jpeg. 2014-01-21 15:29:52 +01:00