1 Encoder firmware API description
2 ================================
4 -------------------------------------------------------------------------------
6 Name CX2341X_ENC_PING_FW
9 Does nothing. Can be used to check if the firmware is responding.
11 -------------------------------------------------------------------------------
13 Name CX2341X_ENC_START_CAPTURE
16 Commences the capture of video, audio and/or VBI data. All encoding
17 parameters must be initialized prior to this API call. Captures frames
18 continuously or until a predefined number of frames have been captured.
28 Bit 0 when set, captures YUV
29 Bit 1 when set, captures PCM audio
30 Bit 2 when set, captures VBI (same as param[0]=3)
31 Bit 3 when set, the capture destination is the decoder
33 Bit 4 when set, the capture destination is the host
34 Note: this parameter is only meaningful for RAW capture type.
36 -------------------------------------------------------------------------------
38 Name CX2341X_ENC_STOP_CAPTURE
41 Ends a capture in progress
43 0=stop at end of GOP (generates IRQ)
44 1=stop immediate (no IRQ)
46 Stream type to stop, see param[0] of API 0x81
48 Subtype, see param[1] of API 0x81
50 -------------------------------------------------------------------------------
52 Name CX2341X_ENC_SET_AUDIO_ID
55 Assigns the transport stream ID of the encoded audio stream
59 -------------------------------------------------------------------------------
61 Name CX2341X_ENC_SET_VIDEO_ID
64 Set video transport stream ID
68 -------------------------------------------------------------------------------
70 Name CX2341X_ENC_SET_PCR_ID
73 Assigns the transport stream ID for PCR packets
77 -------------------------------------------------------------------------------
79 Name CX2341X_ENC_SET_FRAME_RATE
82 Set video frames per second. Change occurs at start of new GOP.
87 -------------------------------------------------------------------------------
89 Name CX2341X_ENC_SET_FRAME_SIZE
92 Select video stream encoding resolution.
94 Height in lines. Default 480
96 Width in pixels. Default 720
98 -------------------------------------------------------------------------------
100 Name CX2341X_ENC_SET_BIT_RATE
103 Assign average video stream bitrate.
105 0=variable bitrate, 1=constant bitrate
107 bitrate in bits per second
109 peak bitrate in bits per second, divided by 400
111 -------------------------------------------------------------------------------
113 Name CX2341X_ENC_SET_GOP_PROPERTIES
116 Setup the GOP structure
120 Number of B frames between the I and P frame, plus 1.
121 For example: IBBPBBPBBPBB --> GOP size: 12, number of B frames: 2+1 = 3
123 -------------------------------------------------------------------------------
125 Name CX2341X_ENC_SET_ASPECT_RATIO
128 Sets the encoding aspect ratio. Changes in the aspect ratio take effect
129 at the start of the next GOP.
140 -------------------------------------------------------------------------------
142 Name CX2341X_ENC_SET_DNR_FILTER_MODE
145 Assign Dynamic Noise Reduction operating mode
147 Bit0: Spatial filter, set=auto, clear=manual
148 Bit1: Temporal filter, set=auto, clear=manual
157 -------------------------------------------------------------------------------
159 Name CX2341X_ENC_SET_DNR_FILTER_PROPS
162 These Dynamic Noise Reduction filter values are only meaningful when
163 the respective filter is set to "manual" (See API 0x9B)
165 Spatial filter: default 0, range 0:15
167 Temporal filter: default 0, range 0:31
169 -------------------------------------------------------------------------------
171 Name CX2341X_ENC_SET_CORING_LEVELS
174 Assign Dynamic Noise Reduction median filter properties.
176 Threshold above which the luminance median filter is enabled.
177 Default: 0, range 0:255
179 Threshold below which the luminance median filter is enabled.
180 Default: 255, range 0:255
182 Threshold above which the chrominance median filter is enabled.
183 Default: 0, range 0:255
185 Threshold below which the chrominance median filter is enabled.
186 Default: 255, range 0:255
188 -------------------------------------------------------------------------------
190 Name CX2341X_ENC_SET_SPATIAL_FILTER_TYPE
193 Assign spatial prefilter parameters
199 3=2D H/V Separable (default)
200 4=2D Symmetric non-separable
204 1=1D Horizontal (default)
206 -------------------------------------------------------------------------------
208 Name CX2341X_ENC_SET_3_2_PULLDOWN
211 3:2 pulldown properties
216 -------------------------------------------------------------------------------
218 Name CX2341X_ENC_SET_VBI_LINE
221 Selects VBI line number.
224 Bit 31 0=top_field, 1=bottom_field
225 Bits 0:31 all set specifies "all lines"
227 VBI line information features: 0=disabled, 1=enabled
229 Slicing: 0=None, 1=Closed Caption
230 Almost certainly not implemented. Set to 0.
232 Luminance samples in this line.
233 Almost certainly not implemented. Set to 0.
235 Chrominance samples in this line
236 Almost certainly not implemented. Set to 0.
238 -------------------------------------------------------------------------------
240 Name CX2341X_ENC_SET_STREAM_TYPE
257 -------------------------------------------------------------------------------
259 Name CX2341X_ENC_SET_OUTPUT_PORT
262 Assign stream output port (not recommended you change setting from default)
268 -------------------------------------------------------------------------------
270 Name CX2341X_ENC_SET_AUDIO_PROPERTIES
273 Set audio stream properties, may be called while encoding is in progress.
274 Note: all bitfields are consistent with ISO11172 documentation except
275 bits 2:3 which ISO docs define as:
280 This discrepancy may indicate a possible error in the documentation.
292 Index | Layer I | Layer II
293 ------+-------------+------------
294 '0000' | free format | free format
295 '0001' | 32 kbit/s | 32 kbit/s
296 '0010' | 64 kbit/s | 48 kbit/s
297 '0011' | 96 kbit/s | 56 kbit/s
298 '0100' | 128 kbit/s | 64 kbit/s
299 '0101' | 160 kbit/s | 80 kbit/s
300 '0110' | 192 kbit/s | 96 kbit/s
301 '0111' | 224 kbit/s | 112 kbit/s
302 '1000' | 256 kbit/s | 128 kbit/s
303 '1001' | 288 kbit/s | 160 kbit/s
304 '1010' | 320 kbit/s | 192 kbit/s
305 '1011' | 352 kbit/s | 224 kbit/s
306 '1100' | 384 kbit/s | 256 kbit/s
307 '1101' | 416 kbit/s | 320 kbit/s
308 '1110' | 448 kbit/s | 384 kbit/s
309 Note: For Layer II, not all combinations of total bitrate
310 and mode are allowed. See ISO11172-3 3-Annex B, Table 3-B.2
317 10:11 Mode Extension used in joint_stereo mode.
318 In Layer I and II they indicate which subbands are in
319 intensity_stereo. All other subbands are coded in stereo.
320 '00' subbands 4-31 in intensity_stereo, bound==4
321 '01' subbands 8-31 in intensity_stereo, bound==8
322 '10' subbands 12-31 in intensity_stereo, bound==12
323 '11' subbands 16-31 in intensity_stereo, bound==16
343 -------------------------------------------------------------------------------
345 Name CX2341X_ENC_HALT_FW
348 The firmware is halted and no further API calls are serviced until the
349 firmware is uploaded again.
351 -------------------------------------------------------------------------------
353 Name CX2341X_ENC_GET_VERSION
356 Returns the version of the encoder firmware.
363 -------------------------------------------------------------------------------
365 Name CX2341X_ENC_SET_GOP_CLOSURE
368 Assigns the GOP open/close property.
373 -------------------------------------------------------------------------------
375 Name CX2341X_ENC_GET_SEQ_END
378 Obtains the sequence end code of the encoder's buffer. When a capture
379 is started a number of interrupts are still generated, the last of
380 which will have Result[0] set to 1 and Result[1] will contain the size
383 State of the transfer (1 if last buffer)
385 If Result[0] is 1, this contains the size of the last buffer, undefined
388 -------------------------------------------------------------------------------
390 Name CX2341X_ENC_SET_PGM_INDEX_INFO
393 Sets the Program Index Information.
401 Elements requested (up to 400)
403 Offset in SDF memory of the table.
405 Number of allocated elements up to a maximum of Param[1]
407 -------------------------------------------------------------------------------
409 Name CX2341X_ENC_SET_VBI_CONFIG
412 Configure VBI settings
415 0 Mode '0' Sliced, '1' Raw
417 '000' insert in extension & user data
418 '001' insert in private packets
419 '010' separate stream and user data
420 '111' separate stream and private data
421 8:15 Stream ID (normally 0xBD)
423 Frames per interrupt (max 8). Only valid in raw mode.
425 Total raw VBI frames. Only valid in raw mode.
435 Observed frames per interrupt in raw mode only. Rage 1 to Param[1]
437 Observed number of frames in raw mode. Range 1 to Param[2]
439 Memory offset to start or raw VBI data
441 -------------------------------------------------------------------------------
443 Name CX2341X_ENC_SET_DMA_BLOCK_SIZE
446 Set DMA transfer block size
448 DMA transfer block size in bytes or frames. When unit is bytes,
449 supported block sizes are 2^7, 2^8 and 2^9 bytes.
451 Unit: 0=bytes, 1=frames
453 -------------------------------------------------------------------------------
455 Name CX2341X_ENC_GET_PREV_DMA_INFO_MB_10
458 Returns information on the previous DMA transfer in conjunction with
459 bit 27 of the interrupt mask. Uses mailbox 10.
465 Maximum size of transfer
467 -------------------------------------------------------------------------------
469 Name CX2341X_ENC_GET_PREV_DMA_INFO_MB_9
472 Returns information on the previous DMA transfer in conjunction with
473 bit 27 of the interrupt mask. Uses mailbox 9.
476 Bit 0 set indicates transfer complete
477 Bit 2 set indicates transfer error
478 Bit 4 set indicates linked list error
482 Presentation Time Stamp bits 0..31
484 Presentation Time Stamp bit 32
486 -------------------------------------------------------------------------------
488 Name CX2341X_ENC_SCHED_DMA_TO_HOST
491 Setup DMA to host operation
493 Memory address of link list
495 Length of link list (wtf: what units ???)
499 -------------------------------------------------------------------------------
501 Name CX2341X_ENC_INITIALIZE_INPUT
504 Initializes the video input
506 -------------------------------------------------------------------------------
508 Name CX2341X_ENC_SET_FRAME_DROP_RATE
511 For each frame captured, skip specified number of frames.
513 Number of frames to skip
515 -------------------------------------------------------------------------------
517 Name CX2341X_ENC_PAUSE_ENCODER
520 During a pause condition, all frames are dropped instead of being encoded.
525 -------------------------------------------------------------------------------
527 Name CX2341X_ENC_REFRESH_INPUT
530 Refreshes the video input
532 -------------------------------------------------------------------------------
534 Name CX2341X_ENC_SET_COPYRIGHT
537 Sets stream copyright property
539 0=Stream is not copyrighted
540 1=Stream is copyrighted
542 -------------------------------------------------------------------------------
544 Name CX2341X_ENC_SET_EVENT_NOTIFICATION
547 Setup firmware to notify the host about a particular event. Host must
548 unmask the interrupt bit.
550 Event (0=refresh encoder input)
552 Notification 0=disabled 1=enabled
556 Mailbox slot, -1 if no mailbox required.
558 -------------------------------------------------------------------------------
560 Name CX2341X_ENC_SET_NUM_VSYNC_LINES
563 Depending on the analog video decoder used, this assigns the number
564 of lines for field 1 and 2.
566 Field 1 number of lines:
571 Field 2 number of lines:
576 -------------------------------------------------------------------------------
578 Name CX2341X_ENC_SET_PLACEHOLDER
581 Provides a mechanism of inserting custom user data in the MPEG stream.
583 0=extension & user data
584 1=private packet with stream ID 0xBD
586 Rate at which to insert data, in units of frames (for private packet)
587 or GOPs (for ext. & user data)
589 Number of data DWORDs (below) to insert
609 -------------------------------------------------------------------------------
611 Name CX2341X_ENC_MUTE_VIDEO
617 0 '0'=video not muted
618 '1'=video muted, creates frames with the YUV color defined below
620 8:15 V chrominance information
621 16:23 U chrominance information
622 24:31 Y luminance information
624 -------------------------------------------------------------------------------
626 Name CX2341X_ENC_MUTE_AUDIO
632 1=audio muted (produces silent mpeg audio stream)
634 -------------------------------------------------------------------------------
636 Name CX2341X_ENC_UNKNOWN
639 Unknown API, it's used by Hauppauge though.
641 0 This is the value Hauppauge uses, Unknown what it means.
643 -------------------------------------------------------------------------------
645 Name CX2341X_ENC_MISC
648 Miscellaneous actions. Not known for 100% what it does. It's really a
649 sort of ioctl call. The first parameter is a command number, the second
653 1=set initial SCR value when starting encoding.
654 2=set quality mode (apparently some test setting).
655 3=setup advanced VIM protection handling (supposedly only for the cx23416
657 Actually it looks like this should be 0 for saa7114/5 based card and 1
658 for cx25840 based cards.
659 4=generate artificial PTS timestamps
661 6=something to do with the quantization matrix
662 7=set navigation pack insertion for DVD
663 8=enable scene change detection (seems to be a failure)
664 9=set history parameters of the video input module
665 10=set input field order of VIM
666 11=set quantization matrix
667 12=reset audio interface
668 13=set audio volume delay