Changeset 5519
- Timestamp:
- 10/25/07 17:25:28 (6 years ago)
- Location:
- experimental/components/Packetizer/trunk/Packetizer-metadata
- Files:
-
- 3 modified
-
src/PacketizerDSP.cpp (modified) (9 diffs)
-
tests/CreateExtract_testsuite.h (modified) (1 diff)
-
tests/EncodeDecodeSubheader_testsuite.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
experimental/components/Packetizer/trunk/Packetizer-metadata/src/PacketizerDSP.cpp
r5512 r5519 49 49 packet_header_length = NUM_CONTROL_CODES*PN_CONTROL_CODE_LENGTH; 50 50 51 // initialize buffers 51 52 buf1 = new unsigned char[MAX_PACKET_SIZE]; 52 53 buf2 = new unsigned char[MAX_PACKET_SIZE]; … … 533 534 // ---- ---- 534 535 // packet_id 32 535 // src_id 16 536 // dst_id 16 537 // app_id 16 538 // port_id 16 539 // expansion 64 536 // src_id 8 537 // dst_id 8 538 // app_id 8 539 // port_id 8 540 // packet_len 16 541 // expansion 48 540 542 buf1[0] = (packet_id >> 0) & 0xFF; 541 543 buf1[1] = (packet_id >> 8) & 0xFF; … … 544 546 545 547 buf1[4] = (src_id >> 0 ) & 0xFF; 546 buf1[5] = (src_id >> 8 ) & 0xFF; 547 548 buf1[6] = (dst_id >> 0 ) & 0xFF; 549 buf1[7] = (dst_id >> 8 ) & 0xFF; 550 551 buf1[8] = (app_id >> 0 ) & 0xFF; 552 buf1[9] = (app_id >> 8 ) & 0xFF; 553 554 buf1[10] = (port_id >> 0 ) & 0xFF; 555 buf1[11] = (port_id >> 8 ) & 0xFF; 556 548 549 buf1[5] = (dst_id >> 0 ) & 0xFF; 550 551 buf1[6] = (app_id >> 0 ) & 0xFF; 552 553 buf1[7] = (port_id >> 0 ) & 0xFF; 554 555 buf1[8] = (packet_data_length >> 0 ) & 0xFF; 556 buf1[9] = (packet_data_length >> 8 ) & 0xFF; 557 558 buf1[10] = 7; 559 buf1[11] = 7; 557 560 buf1[12] = 7; 558 561 buf1[13] = 7; … … 587 590 rs = init_rs_char(symsize,0x43,1,1,nroots,npad); 588 591 encode_rs_char(rs, buf1, &buf1[kk]); 592 free_rs_char(rs); 589 593 590 594 // 5. unpack to output buffer … … 765 769 int nerrors(0); 766 770 nerrors = decode_rs_char(rs, buf2, 0, 0); 771 free_rs_char(rs); 767 772 768 773 // 3. repack 27 6-bit symbols (-2 bits) to 20 8-bit symbols … … 795 800 // ---- ---- 796 801 // packet_id 32 797 // src_id 16 798 // dst_id 16 799 // app_id 16 800 // port_id 16 801 // expansion 64 802 // src_id 8 803 // dst_id 8 804 // app_id 8 805 // port_id 8 806 // packet_len 16 807 // expansion 48 802 808 packet_id = 0; 803 809 packet_id = 0; … … 808 814 809 815 src_id = 0; 810 src_id |= (buf2[4] << 0); 811 src_id |= (buf2[5] << 8); 816 src_id |= buf2[4]; 812 817 813 818 dst_id = 0; 814 dst_id |= (buf2[6] << 0); 815 dst_id |= (buf2[7] << 8); 819 dst_id |= buf2[5]; 816 820 817 821 app_id = 0; 818 app_id |= (buf2[8] << 0); 819 app_id |= (buf2[9] << 8); 822 app_id |= buf2[6]; 820 823 821 824 port_id = 0; 822 port_id |= (buf2[10] << 0); 823 port_id |= (buf2[11] << 8); 825 port_id |= buf2[7]; 826 827 packet_data_length = 0; 828 packet_data_length |= buf2[8]; 829 packet_data_length |= buf2[9]; 824 830 825 831 return true; … … 985 991 nw += nn; 986 992 } 993 free_rs_char(rs); 987 994 988 995 // 4. unpack data: move 4-bit symbols from buf1 to 1-bit symbols in output … … 1075 1082 nw += kk; 1076 1083 } 1084 free_rs_char(rs); 1077 1085 1078 1086 // 3. calculate and compare crc/checksum (16-bit) -
experimental/components/Packetizer/trunk/Packetizer-metadata/tests/CreateExtract_testsuite.h
r5509 r5519 95 95 // Initialize properties 96 96 p.packet_id = 32768; 97 p.src_id = 567;97 p.src_id = 247; 98 98 p.dst_id = 129; 99 p.port_id = 18 89;99 p.port_id = 189; 100 100 p.app_id = 10; 101 101 p.ConfigurePacketType( PACKET_RS_512 ); -
experimental/components/Packetizer/trunk/Packetizer-metadata/tests/EncodeDecodeSubheader_testsuite.h
r5504 r5519 59 59 // Set encoder packet id property 60 60 enc.packet_id = 68392; 61 enc.src_id = 859;62 enc.dst_id = 906;61 enc.src_id = 255; 62 enc.dst_id = 159; 63 63 enc.port_id = 254; 64 64 enc.app_id = 211;