Author: ods15
Date: Fri Nov 17 15:41:18 2006
New Revision: 222
Modified:
trunk/libnut/libnut.h
trunk/libnut/muxer.c
trunk/nututils/nutmerge.c
Log:
some cleanups/changes to frame_table_input code
Modified: trunk/libnut/libnut.h
============================================================
==================
--- trunk/libnut/libnut.h (original)
+++ trunk/libnut/libnut.h Fri Nov 17 15:41:18 2006
 -56,14
+56,13 
} nut_stream_header_t;
typedef struct {
- int tmp_flag; // -1 => end
- int tmp_fields;
- int tmp_pts; // tmp_fields = 1
- int tmp_mul; // tmp_fields = 2
- int tmp_stream; // tmp_fields = 3
- int tmp_size; // tmp_fields = 4
- int count; // tmp_fields = 6 (5 is reserved)
-} frame_table_input_t;
+ int flag; // -1 => end
+ int pts;
+ int stream;
+ int mul;
+ int size;
+ int count;
+} nut_frame_table_input_t;
typedef struct {
void * (*malloc)(size_t size);
 -105,7
+104,7 
int write_index;
int realtime_stream; // implies no write_index
int max_distance;
- frame_table_input_t * fti;
+ nut_frame_table_input_t * fti;
} nut_muxer_opts_t;
typedef struct {
Modified: trunk/libnut/muxer.c
============================================================
==================
--- trunk/libnut/muxer.c (original)
+++ trunk/libnut/muxer.c Fri Nov 17 15:41:18 2006
 -523,7
+523,7 
nut_context_t * nut_muxer_init(const nut_muxer_opts_t *
mopts, const nut_stream_header_t s[], const
nut_info_packet_t info[]) {
nut_context_t * nut;
- int i;
+ int i, n;
// TODO check that all input is valid
if (mopts->alloc.malloc) nut =
mopts->alloc.malloc(sizeof(nut_context_t));
 -549,37
+549,24 
if (nut->max_distance > 65536) nut->max_distance
= 65536;
- {
- int j, n;
- int flag, fields, timestamp = 0, mul = 1, stream = 0,
size, count;
-
- for(n=i=0; i < 256; n++) {
- assert(mopts->fti[n].tmp_flag != -1);
- flag = mopts->fti[n].tmp_flag;
- fields = mopts->fti[n].tmp_fields;
- if (fields > 0) timestamp = mopts->fti[n].tmp_pts;
- if (fields > 1) mul = mopts->fti[n].tmp_mul;
- if (fields > 2) stream =
mopts->fti[n].tmp_stream;
- if (fields > 3) size = mopts->fti[n].tmp_size;
- else size = 0;
- if (fields > 5) count = mopts->fti[n].count;
- else count = mul - size;
+ for (n=i=0; i < 256; n++) {
+ int j;
+ assert(mopts->fti[n].flag != -1);
- for(j = 0; j < count && i < 256; j++, i++)
{
+ for(j = 0; j < mopts->fti[n].count && i
< 256; j++, i++) {
if (i == 'N') {
nut->ft[i].flags = FLAG_INVALID;
j--;
continue;
}
- nut->ft[i].flags = flag;
- nut->ft[i].stream = stream;
- nut->ft[i].mul = mul;
- nut->ft[i].lsb = size + j;
- nut->ft[i].pts_delta = timestamp;
+ nut->ft[i].flags = mopts->fti[n].flag;
+ nut->ft[i].pts_delta = mopts->fti[n].pts;
+ nut->ft[i].mul = mopts->fti[n].mul;
+ nut->ft[i].stream = mopts->fti[n].stream;
+ nut->ft[i].lsb = mopts->fti[n].size + j;
}
}
- assert(mopts->fti[n].tmp_flag == -1);
- }
+ assert(mopts->fti[n].flag == -1);
nut->sync_overhead = 0;
Modified: trunk/nututils/nutmerge.c
============================================================
==================
--- trunk/nututils/nutmerge.c (original)
+++ trunk/nututils/nutmerge.c Fri Nov 17 15:41:18 2006
 -29,32
+29,32 
NULL
};
-frame_table_input_t ft_default[] = {
+nut_frame_table_input_t ft_default[] = {
// There must be atleast this safety net:
- //{ 4128, 3, 0, 1, 0, 0, 0 },
- //{ flag, fields, pts, mul, stream, size, count }
- { 8192, 0, 0, 1, 0, 0, 0 }, //
invalid 0x00
- { 56, 0, 0, 1, 0, 0, 0 }, //
safety net non key frame
- { 56, 0, 0, 1, 0, 0, 0 }, //
safety net key frame
- { 4128, 0, 0, 1, 0, 0, 0 }, // one
more safety net
- { 27, 0, 0, 1, 0, 0, 0 }, // EOR
frame
- { 1, 4, 1, 337, 1, 336, 0 }, // used
82427 times
- { 1, 4, 1, 385, 1, 384, 0 }, // used
56044 times
- { 0, 4, 2, 7, 0, 6, 0 }, // used
20993 times
- { 0, 4, 1, 7, 0, 6, 0 }, // used
10398 times
- { 1, 4, 1, 481, 1, 480, 0 }, // used
3527 times
- { 1, 4, 1, 289, 1, 288, 0 }, // used
2042 times
- { 1, 4, 1, 577, 1, 576, 0 }, // used
1480 times
- { 1, 4, 1, 673, 1, 672, 0 }, // used
862 times
- { 1, 4, 1, 769, 1, 768, 0 }, // used
433 times
- { 1, 4, 1, 961, 1, 960, 0 }, // used
191 times
- { 32, 3, 2, 101, 0, 0, 0 }, //
"1.2.0" => 14187
- { 32, 3, -1, 40, 0, 0, 0 }, //
"1.-1.0" => 5707
- { 32, 3, 1, 81, 0, 0, 0 }, //
"1.1.0" => 11159
- { 33, 3, 1, 11, 0, 0, 0 }, //
"1.1.1" => 1409
- { 105, 3, 0, 6, 0, 0, 0 }, //
checksum for video
- { 8192, 2, 0, 1, 0, 0, 0 }, //
invalid 0xFF
- { -1, 0, 0, 0, 0, 0, 0 }, // end
+ //{ 4128, 0, 0, 1, 0, 1 },
+ //{ flag, pts, stream, mul, size, count }
+ { 8192, 0, 0, 1, 0, 1 }, // invalid
0x00
+ { 56, 0, 0, 1, 0, 1 }, // safety net
non key frame
+ { 57, 0, 0, 1, 0, 1 }, // safety net
key frame
+ { 4128, 0, 0, 1, 0, 1 }, // one more
safety net
+ { 27, 0, 0, 1, 0, 1 }, // EOR frame
+ { 1, 1, 1, 337, 336, 1 }, // used 82427
times
+ { 1, 1, 1, 385, 384, 1 }, // used 56044
times
+ { 0, 2, 0, 7, 6, 1 }, // used 20993
times
+ { 0, 1, 0, 7, 6, 1 }, // used 10398
times
+ { 1, 1, 1, 481, 480, 1 }, // used 3527
times
+ { 1, 1, 1, 289, 288, 1 }, // used 2042
times
+ { 1, 1, 1, 577, 576, 1 }, // used 1480
times
+ { 1, 1, 1, 673, 672, 1 }, // used 862
times
+ { 1, 1, 1, 769, 768, 1 }, // used 433
times
+ { 1, 1, 1, 961, 960, 1 }, // used 191
times
+ { 32, 2, 0, 101, 0, 101 }, //
"1.2.0" => 14187
+ { 32, -1, 0, 40, 0, 40 }, //
"1.-1.0" => 5707
+ { 32, 1, 0, 81, 0, 81 }, //
"1.1.0" => 11159
+ { 33, 1, 0, 11, 0, 11 }, //
"1.1.1" => 1409
+ { 105, 0, 0, 6, 0, 6 }, // checksum
for video
+ { 8192, 0, 0, 1, 0, 1 }, // invalid
0xFF
+ { -1, 0, 0, 0, 0, 0 }, // end
};
void push_packet(stream_t * stream, packet_t * p) {
_______________________________________________
NUT-devel mailing list
NUT-devel mplayerhq.hu
http://lists.mplayerhq.hu/mailman/listinfo/nut-devel
|