Opened 14 years ago

Closed 14 years ago

#18 closed defect (fixed)

Minor memory leak in both encoder and decoder in TMuC 0.5

Reported by: li@… Owned by: fbossen
Priority: minor Milestone:
Component: HM Version:
Keywords: Cc: fbossen, ksuehring, davidf, jct-vc@…


When QC_MDDT is defined, the following variables allocated in source\Lib\TLibCommon\TComRom.cpp are not freed in the decoder. Some of them are not freed in the encoder.

UInt *scanOrder4x4[9];
UInt *scanOrder4x4X[9];
UInt *scanOrder4x4Y[9];
UInt *scanOrder8x8[9];
UInt *scanOrder8x8X[9];
UInt *scanOrder8x8Y[9];
UInt *scanStats4x4[9];
UInt *scanStats8x8[9];

UInt *scanOrder16x16[NUM_SCANS_16x16];
UInt *scanOrder16x16X[NUM_SCANS_16x16];
UInt *scanOrder16x16Y[NUM_SCANS_16x16];
UInt *scanStats16x16[NUM_SCANS_16x16];

UInt *scanOrder32x32[NUM_SCANS_32x32];
UInt *scanOrder32x32X[NUM_SCANS_32x32];
UInt *scanOrder32x32Y[NUM_SCANS_32x32];
UInt *scanStats32x32[NUM_SCANS_32x32];

UInt *scanOrder64x64[NUM_SCANS_64x64];
UInt *scanOrder64x64X[NUM_SCANS_64x64];
UInt *scanOrder64x64Y[NUM_SCANS_64x64];
UInt *scanStats64x64[NUM_SCANS_64x64];

In TMuC 0.5 encoder, some of these variables are released in Void TAppEncTop::encode(). I think we'd better release them in Void destroyROM() (TComRom.cpp). Otherwise, we have to keep duplicate code in both encoder and decoder. To fix this problem, maybe we can put the following code at the end of Void destroyROM() and remove the related code in Void TAppEncTop::encode().


int ipredmode;
for(ipredmode=0; ipredmode<9; ipredmode++)

delete scanOrder4x4[ipredmode];
delete scanOrder4x4X[ipredmode];
delete scanOrder4x4Y[ipredmode];
delete scanOrder8x8[ipredmode];
delete scanOrder8x8X[ipredmode];
delete scanOrder8x8Y[ipredmode];
delete scanStats4x4[ipredmode];
delete scanStats8x8[ipredmode];


for (int z=0; z < NUM_SCANS_16x16; z++)

delete scanOrder16x16[z];
delete scanOrder16x16X[z];
delete scanOrder16x16Y[z];
delete scanStats16x16[z];

for (int z=0; z < NUM_SCANS_32x32; z++)

delete scanOrder32x32[z];
delete scanOrder32x32X[z];
delete scanOrder32x32Y[z];
delete scanStats32x32[z];

for (int z=0; z < NUM_SCANS_64x64; z++)

delete scanOrder64x64[z];
delete scanOrder64x64X[z];
delete scanOrder64x64Y[z];
delete scanStats64x64[z];



Change History (5)

comment:1 Changed 14 years ago by fbossen

  • Owner set to fbossen
  • Status changed from new to accepted

comment:2 Changed 14 years ago by fbossen

  • Resolution set to fixed
  • Status changed from accepted to closed

comment:3 Changed 12 years ago by davidf

  • Component set to HM

Updating component after adding WD (Text) tickets

comment:4 Changed 12 years ago by davidf

  • Cc fbossen ksuehring davidf added

comment:5 Changed 12 years ago by davidf

  • Cc jct-vc@… added
Note: See TracTickets for help on using tickets.

This list contains all users that will be notified about changes made to this ticket.

These roles will be notified: Reporter, Owner, Subscriber, Participant

  • David Flynn(Subscriber, Participant)
  • Frank Bossen(Owner, Subscriber, Participant)
  • jct-vc@…(Subscriber)
  • karl.sharman@…(Always)
  • Karsten Suehring(Subscriber, Always)
  • li@…(Reporter)