58 lines
2.5 KiB
Diff
58 lines
2.5 KiB
Diff
---
|
|
mpeg2enc/imageplanes.cc | 11 +++++++----
|
|
mpeg2enc/imageplanes.hh | 1 +
|
|
2 files changed, 8 insertions(+), 4 deletions(-)
|
|
|
|
Index: mjpegtools-2.2.0/mpeg2enc/imageplanes.cc
|
|
===================================================================
|
|
--- mjpegtools-2.2.0.orig/mpeg2enc/imageplanes.cc 2021-02-11 07:02:26.000000000 +0100
|
|
+++ mjpegtools-2.2.0/mpeg2enc/imageplanes.cc 2021-05-11 12:30:02.082436818 +0200
|
|
@@ -19,19 +19,22 @@ ImagePlanes::ImagePlanes( EncoderParams
|
|
switch( c )
|
|
{
|
|
case 0 : // Y plane
|
|
- planes[c] = new uint8_t[encparams.lum_buffer_size];
|
|
+ raw_planes[c] = new uint8_t[encparams.lum_buffer_size + 0x10];
|
|
+ planes[c] = (uint8_t *)((((unsigned long)raw_planes[c]) + 0x10) & ~0xf);
|
|
BorderMark( planes[c] ,
|
|
encparams.enc_width,encparams.enc_height,
|
|
encparams.phy_width,encparams.phy_height);
|
|
break;
|
|
case 1 : // U plane
|
|
case 2 : // V plane
|
|
- planes[c] = new uint8_t[encparams.chrom_buffer_size];
|
|
+ raw_planes[c] = new uint8_t[encparams.chrom_buffer_size + 0x10];
|
|
+ planes[c] = (uint8_t *)((((unsigned long)raw_planes[c]) + 0x10) & ~0xf);
|
|
BorderMark( planes[c],
|
|
encparams.enc_chrom_width, encparams.enc_chrom_height,
|
|
encparams.phy_chrom_width,encparams.phy_chrom_height);
|
|
break;
|
|
default : // TODO: shift Y subsampled data from appended in Y buffer to seperate planes
|
|
+ raw_planes[c] = 0;
|
|
planes[c] = 0;
|
|
break;
|
|
}
|
|
@@ -43,8 +46,8 @@ ImagePlanes::ImagePlanes( EncoderParams
|
|
{
|
|
for( int c = 0; c < NUM_PLANES; ++c )
|
|
{
|
|
- if( planes[c] != 0 )
|
|
- delete [] planes[c];
|
|
+ if( raw_planes[c] != 0 )
|
|
+ delete [] raw_planes[c];
|
|
}
|
|
DiscardUserData();
|
|
}
|
|
Index: mjpegtools-2.2.0/mpeg2enc/imageplanes.hh
|
|
===================================================================
|
|
--- mjpegtools-2.2.0.orig/mpeg2enc/imageplanes.hh 2021-02-11 07:02:26.000000000 +0100
|
|
+++ mjpegtools-2.2.0/mpeg2enc/imageplanes.hh 2021-05-11 12:30:02.082436818 +0200
|
|
@@ -55,6 +55,7 @@ class ImagePlanes
|
|
int image_data_width, int image_data_height);
|
|
protected:
|
|
uint8_t *planes[NUM_PLANES];
|
|
+ uint8_t *raw_planes[NUM_PLANES];
|
|
};
|
|
|
|
|