comparison vorbis_enc.c @ 3904:24e73ad62e40 libavcodec

Original Commit: r105 | ods15 | 2006-10-01 18:09:55 +0200 (Sun, 01 Oct 2006) | 2 lines slight simplification for channel coupling
author ods15
date Mon, 02 Oct 2006 06:09:30 +0000
parents 7a57a82cfa10
children 557b95209664
comparison
equal deleted inserted replaced
3903:7a57a82cfa10 3904:24e73ad62e40
1422 for (i = 0; i < mapping->coupling_steps; i++) { 1422 for (i = 0; i < mapping->coupling_steps; i++) {
1423 float * mag = venc->coeffs + mapping->magnitude[i] * samples; 1423 float * mag = venc->coeffs + mapping->magnitude[i] * samples;
1424 float * ang = venc->coeffs + mapping->angle[i] * samples; 1424 float * ang = venc->coeffs + mapping->angle[i] * samples;
1425 int j; 1425 int j;
1426 for (j = 0; j < samples; j++) { 1426 for (j = 0; j < samples; j++) {
1427 float m = mag[j];
1428 float a = ang[j]; 1427 float a = ang[j];
1429 if (m > 0) { 1428 ang[j] -= mag[j];
1430 ang[j] = m - a; 1429 if (mag[j] > 0) ang[j] = -ang[j];
1431 if (a > m) mag[j] = a; 1430 if (ang[j] < 0) mag[j] = a;
1432 else mag[j] = m;
1433 } else {
1434 ang[j] = a - m;
1435 if (a > m) mag[j] = m;
1436 else mag[j] = a;
1437 }
1438 } 1431 }
1439 } 1432 }
1440 1433
1441 residue_encode(venc, &venc->residues[mapping->residue[mapping->mux[0]]], &pb, venc->coeffs, samples, venc->channels); 1434 residue_encode(venc, &venc->residues[mapping->residue[mapping->mux[0]]], &pb, venc->coeffs, samples, venc->channels);
1442 1435