diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2014-03-02 17:35:11 +0400 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2014-03-02 17:35:11 +0400 |
commit | ece3566afefc241f98e064f9377fd0bca2c7cef7 (patch) | |
tree | 1b0089b80d8ca06429916216c3b005a58fc20f30 /decoder | |
parent | 879fe91e5dc6777c06fe675d167af0b822e0d347 (diff) |
Use 64 byte aligned memory for frame buffers
Diffstat (limited to 'decoder')
-rw-r--r-- | decoder/LAVVideo/decoders/pixfmt.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/decoder/LAVVideo/decoders/pixfmt.cpp b/decoder/LAVVideo/decoders/pixfmt.cpp index 4af4e4a2..117dc541 100644 --- a/decoder/LAVVideo/decoders/pixfmt.cpp +++ b/decoder/LAVVideo/decoders/pixfmt.cpp @@ -84,10 +84,11 @@ AVPixelFormat getFFPixelFormatFromLAV(LAVPixelFormat pixFmt, int bpp) static void free_buffers(struct LAVFrame *pFrame) { - av_freep(&pFrame->data[0]); - av_freep(&pFrame->data[1]); - av_freep(&pFrame->data[2]); - av_freep(&pFrame->data[3]); + _aligned_free(pFrame->data[0]); + _aligned_free(pFrame->data[1]); + _aligned_free(pFrame->data[2]); + _aligned_free(pFrame->data[3]); + memset(pFrame->data, 0, sizeof(pFrame->data)); } HRESULT AllocLAVFrameBuffers(LAVFrame *pFrame, int stride) @@ -105,7 +106,7 @@ HRESULT AllocLAVFrameBuffers(LAVFrame *pFrame, int stride) for (int plane = 0; plane < desc.planes; plane++) { int planeStride = stride / desc.planeWidth[plane]; size_t size = planeStride * (pFrame->height / desc.planeHeight[plane]); - pFrame->data[plane] = (BYTE *)av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE); + pFrame->data[plane] = (BYTE *)_aligned_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE, 64); pFrame->stride[plane] = planeStride; } |