	.file	"extr_venc_h264_if.c_h264_enc_encode.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"opt %d ->"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC1:
	.string	"h264_encode_frame prepend SPS/PPS"
	.align 8
.LC2:
	.string	"hdr %d filler %d frame %d bs %d"
	.align 8
.LC3:
	.string	"venc_start_opt %d not supported"
	.section	.rodata.str1.1
.LC4:
	.string	"opt %d <-"
	.text
	.p2align 4
	.type	h264_enc_encode, @function
h264_enc_encode:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rcx
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12d, esi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, r8
	sub	rsp, 72
	.cfi_def_cfa_offset 128
	mov	r15, QWORD PTR 8[rdi]
	mov	QWORD PTR 8[rsp], rdx
	mov	edx, esi
	lea	rsi, .LC0[rip]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 56[rsp], rax
	xor	eax, eax
	call	mtk_vcodec_debug@PLT
	mov	rax, QWORD PTR [r15]
	mov	edi, DWORD PTR [rax]
	call	enable_irq@PLT
	cmp	r12d, 128
	je	.L2
	cmp	r12d, 129
	je	.L3
	mov	edx, r12d
	lea	rsi, .LC3[rip]
	mov	rdi, rbp
	call	mtk_vcodec_err@PLT
	mov	r14d, DWORD PTR EINVAL[rip]
	neg	r14d
.L6:
	mov	rax, QWORD PTR [r15]
	mov	edi, DWORD PTR [rax]
	call	disable_irq@PLT
	xor	eax, eax
	mov	edx, r12d
	mov	rdi, rbp
	lea	rsi, .LC4[rip]
	call	mtk_vcodec_debug@PLT
	mov	rax, QWORD PTR 56[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L20
	add	rsp, 72
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r14d
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	lea	rdx, 44[rsp]
	mov	rsi, r13
	mov	rdi, rbp
	call	h264_encode_header@PLT
	mov	r14d, eax
	test	eax, eax
	jne	.L6
	mov	eax, DWORD PTR 44[rsp]
	mov	DWORD PTR 4[rbx], 0
	mov	DWORD PTR [rbx], eax
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	mov	eax, DWORD PTR 4[rbp]
	test	eax, eax
	je	.L21
	lea	rsi, .LC1[rip]
	mov	rdi, rbp
	xor	eax, eax
	call	mtk_vcodec_debug@PLT
	lea	rdx, 36[rsp]
	mov	rsi, r13
	mov	rdi, rbp
	call	h264_encode_header@PLT
	mov	r14d, eax
	test	eax, eax
	jne	.L6
	mov	r10d, DWORD PTR 36[rsp]
	mov	r11d, r10d
	mov	r9d, r10d
	and	r11d, 127
	je	.L10
	mov	eax, DWORD PTR H264_FILLER_MARKER_SIZE[rip]
	add	eax, r11d
	cmp	eax, 128
	jg	.L11
	mov	eax, 128
	sub	eax, r11d
	mov	r11d, eax
.L12:
	mov	esi, r10d
	mov	edx, r11d
	add	esi, DWORD PTR 8[r13]
	mov	rdi, rbp
	mov	DWORD PTR 24[rsp], r10d
	mov	DWORD PTR 20[rsp], r11d
	call	h264_encode_filler@PLT
	mov	r11d, DWORD PTR 20[rsp]
	mov	r10d, DWORD PTR 24[rsp]
	lea	r9d, [r11+r10]
.L10:
	mov	eax, DWORD PTR 8[r13]
	mov	rsi, QWORD PTR 8[rsp]
	lea	rcx, 40[rsp]
	mov	rdi, rbp
	lea	rdx, 44[rsp]
	mov	DWORD PTR 28[rsp], r10d
	add	eax, r10d
	mov	DWORD PTR 24[rsp], r11d
	add	eax, r11d
	mov	DWORD PTR 20[rsp], r9d
	mov	DWORD PTR 52[rsp], eax
	mov	eax, r10d
	add	eax, DWORD PTR 4[r13]
	add	eax, r11d
	mov	DWORD PTR 48[rsp], eax
	mov	eax, DWORD PTR 0[r13]
	sub	eax, r9d
	mov	DWORD PTR 44[rsp], eax
	call	h264_encode_frame@PLT
	mov	r14d, eax
	test	eax, eax
	jne	.L6
	mov	r8d, DWORD PTR 40[rsp]
	mov	r9d, DWORD PTR 20[rsp]
	mov	rdi, rbp
	xor	eax, eax
	mov	r11d, DWORD PTR 24[rsp]
	mov	r10d, DWORD PTR 28[rsp]
	lea	rsi, .LC2[rip]
	add	r9d, r8d
	mov	DWORD PTR [rbx], r9d
	mov	ecx, r11d
	mov	edx, r10d
	call	mtk_vcodec_debug@PLT
	mov	DWORD PTR 4[rbp], 0
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L21:
	mov	rsi, QWORD PTR 8[rsp]
	mov	rcx, rbx
	mov	rdx, r13
	mov	rdi, rbp
	call	h264_encode_frame@PLT
	mov	r14d, eax
	test	eax, eax
	jne	.L6
.L18:
	mov	eax, DWORD PTR 0[rbp]
	xor	r14d, r14d
	mov	DWORD PTR 4[rbx], eax
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L11:
	mov	eax, 256
	sub	eax, r11d
	mov	r11d, eax
	jmp	.L12
.L20:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	h264_enc_encode, .-h264_enc_encode
	.comm	H264_FILLER_MARKER_SIZE,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_venc_h264_if.c_h264_enc_encode.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"opt %d ->\000"
	.align	2
.LC1:
	.ascii	"h264_encode_frame prepend SPS/PPS\000"
	.align	2
.LC2:
	.ascii	"hdr %d filler %d frame %d bs %d\000"
	.align	2
.LC3:
	.ascii	"venc_start_opt %d not supported\000"
	.align	2
.LC4:
	.ascii	"opt %d <-\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	h264_enc_encode, %function
h264_enc_encode:
	@ args = 4, pretend = 0, frame = 24
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r4, r1
	ldr	r9, [r0, #8]
	mov	r7, r3
	ldr	r3, .L20
	sub	sp, sp, #36
	mov	r8, r2
	mov	r2, r1
	ldr	r1, .L20+4
	ldr	r3, [r3]
	str	r3, [sp, #28]
	mov	r3,#0
	mov	r5, r0
	ldr	r10, [sp, #72]
	bl	mtk_vcodec_debug
	ldr	r3, [r9]
	ldr	r0, [r3]
	bl	enable_irq
	cmp	r4, #128
	beq	.L2
	cmp	r4, #129
	beq	.L3
	mov	r2, r4
	mov	r0, r5
	ldr	r1, .L20+8
	bl	mtk_vcodec_err
	ldr	r3, .L20+12
	ldr	r0, [r3]
	rsb	r6, r0, #0
.L6:
	ldr	r3, [r9]
	ldr	r0, [r3]
	bl	disable_irq
	mov	r2, r4
	mov	r0, r5
	ldr	r1, .L20+16
	bl	mtk_vcodec_debug
	ldr	r3, .L20
	ldr	r2, [r3]
	ldr	r3, [sp, #28]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L18
	mov	r0, r6
	add	sp, sp, #36
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L2:
	mov	r1, r7
	mov	r0, r5
	add	r2, sp, #16
	bl	h264_encode_header
	subs	r6, r0, #0
	ldreq	r3, [sp, #16]
	stmeq	r10, {r3, r6}
	b	.L6
.L3:
	ldr	r3, [r5, #4]
	cmp	r3, #0
	beq	.L19
	ldr	r1, .L20+20
	mov	r0, r5
	bl	mtk_vcodec_debug
	mov	r1, r7
	mov	r0, r5
	add	r2, sp, #8
	bl	h264_encode_header
	subs	r6, r0, #0
	bne	.L6
	ldr	r3, [sp, #8]
	ands	fp, r3, #127
	mov	r6, r3
	moveq	ip, r3
	beq	.L10
	ldr	r3, .L20+24
	ldr	r1, [r7, #8]
	ldr	r3, [r3]
	mov	r0, r5
	add	r3, fp, r3
	cmp	r3, #128
	rsble	fp, fp, #128
	rsbgt	fp, fp, #256
	mov	r2, fp
	add	r1, r6, r1
	bl	h264_encode_filler
	add	r3, fp, r6
	mov	ip, r3
.L10:
	ldmib	r7, {r0, r2}
	ldr	r3, [r7]
	add	r2, r6, r2
	add	r0, r6, r0
	add	r2, r2, fp
	add	r0, r0, fp
	mov	r1, r8
	str	r2, [sp, #24]
	str	r0, [sp, #20]
	mov	r8, ip
	mov	r0, r5
	sub	ip, r3, ip
	add	r2, sp, #16
	add	r3, sp, #12
	str	ip, [sp, #16]
	bl	h264_encode_frame
	mov	r7, r6
	subs	r6, r0, #0
	bne	.L6
	ldr	r0, [sp, #12]
	mov	r3, fp
	add	r1, r8, r0
	str	r1, [r10]
	mov	r2, r7
	stm	sp, {r0, r1}
	mov	r0, r5
	ldr	r1, .L20+28
	bl	mtk_vcodec_debug
	ldr	r3, [r5]
	str	r6, [r5, #4]
	str	r3, [r10, #4]
.L9:
	mov	r6, #0
	b	.L6
.L19:
	mov	r2, r7
	mov	r1, r8
	mov	r3, r10
	mov	r0, r5
	bl	h264_encode_frame
	subs	r6, r0, #0
	bne	.L6
	ldr	r3, [r5]
	str	r3, [r10, #4]
	b	.L9
.L18:
	bl	__stack_chk_fail
.L21:
	.align	2
.L20:
	.word	.LC5
	.word	.LC0
	.word	.LC3
	.word	EINVAL
	.word	.LC4
	.word	.LC1
	.word	H264_FILLER_MARKER_SIZE
	.word	.LC2
	.size	h264_enc_encode, .-h264_enc_encode
	.comm	H264_FILLER_MARKER_SIZE,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
