project stringclasses 2
values | commit_id stringlengths 40 40 | target int64 0 1 | func stringlengths 26 142k | idx int64 0 27.3k |
|---|---|---|---|---|
qemu | 80e1eea37a25a7696137e680285e36d0bfdc9f34 | 1 | static void pci_config(void)
{
QVirtioPCIDevice *dev;
QOSState *qs;
int n_size = TEST_IMAGE_SIZE / 2;
uint64_t capacity;
qs = pci_test_start();
dev = virtio_blk_pci_init(qs->pcibus, PCI_SLOT);
capacity = qvirtio_config_readq(&dev->vdev, 0);
g_assert_cmpint(capacity, ==, TE... | 22,613 |
FFmpeg | 1f467220cfd1664782b1fe210bbc9342ad460fd2 | 1 | static int draw_slice(AVFilterLink *inlink, int y0, int h, int slice_dir)
{
AlphaExtractContext *extract = inlink->dst->priv;
AVFilterBufferRef *cur_buf = inlink->cur_buf;
AVFilterBufferRef *out_buf = inlink->dst->outputs[0]->out_buf;
if (extract->is_packed_rgb) {
int x, y;
uint... | 22,614 |
FFmpeg | bc0a603c7888c1faf4db580829e103b21442b6e4 | 1 | static int sad16_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
{
int i;
int s;
const vector unsigned int zero = (const vector unsigned int)vec_splat_u32(0);
vector unsigned char perm1, perm2, *pix1v, *pix2v;
vector unsigned char t1, t2, t3,t4, t5;
vector unsigned in... | 22,616 |
FFmpeg | 7f526efd17973ec6d2204f7a47b6923e2be31363 | 1 | void rgb8tobgr8(const uint8_t *src, uint8_t *dst, unsigned int src_size)
{
unsigned i;
unsigned num_pixels = src_size;
for(i=0; i<num_pixels; i++)
{
unsigned b,g,r;
register uint8_t rgb;
rgb = src[i];
r = (rgb&0x07);
g = (rgb&0x38)>>3;
b = (rgb&0xC0)>>6;
dst[i] = ((b<<... | 22,617 |
qemu | b946a1533209f61a93e34898aebb5b43154b99c3 | 1 | static int net_vde_init(VLANState *vlan, const char *model,
const char *name, const char *sock,
int port, const char *group, int mode)
{
VDEState *s;
char *init_group = strlen(group) ? (char *)group : NULL;
char *init_sock = strlen(sock) ? (char *)sock :... | 22,618 |
FFmpeg | 36b7e983a664d20dc3809704b47cf8d59895b4de | 1 | static int vorbis_parse_setup_hdr_residues(vorbis_context *vc){
GetBitContext *gb=&vc->gb;
uint_fast8_t i, j, k;
vc->residue_count=get_bits(gb, 6)+1;
vc->residues=av_mallocz(vc->residue_count * sizeof(vorbis_residue));
AV_DEBUG(" There are %d residues. \n", vc->residue_count);
for(i=0;i<vc->resi... | 22,620 |
FFmpeg | a33c7dd21362a694692d0dc30fdbffae5a5d837e | 1 | static int flashsv_decode_block(AVCodecContext *avctx, AVPacket *avpkt,
GetBitContext *gb, int block_size,
int width, int height, int x_pos, int y_pos,
int blk_idx)
{
struct FlashSVContext *s = avctx->priv_data;
... | 22,621 |
qemu | e175bce587936bf479889881488821ea8d61c89c | 1 | void breakpoint_handler(CPUX86State *env)
{
CPUBreakpoint *bp;
if (env->watchpoint_hit) {
if (env->watchpoint_hit->flags & BP_CPU) {
env->watchpoint_hit = NULL;
if (check_hw_breakpoints(env, 0))
raise_exception(env, EXCP01_DB);
else
... | 22,622 |
qemu | a32354e206895400d17c3de9a8df1de96d3df289 | 1 | static uint32_t m5206_mbar_readl(void *opaque, target_phys_addr_t offset)
{
m5206_mbar_state *s = (m5206_mbar_state *)opaque;
int width;
offset &= 0x3ff;
if (offset > 0x200) {
hw_error("Bad MBAR read offset 0x%x", (int)offset);
}
width = m5206_mbar_width[offset >> 2];
if (wi... | 22,623 |
qemu | 47d4be12c3997343e436c6cca89aefbbbeb70863 | 1 | static void test_qemu_strtoul_empty(void)
{
const char *str = "";
char f = 'X';
const char *endptr = &f;
unsigned long res = 999;
int err;
err = qemu_strtoul(str, &endptr, 0, &res);
g_assert_cmpint(err, ==, 0);
g_assert_cmpint(res, ==, 0);
g_assert(endptr == str);
}
| 22,624 |
qemu | 4c315c27661502a0813b129e41c0bf640c34a8d6 | 1 | static void lm32_cpu_class_init(ObjectClass *oc, void *data)
{
LM32CPUClass *lcc = LM32_CPU_CLASS(oc);
CPUClass *cc = CPU_CLASS(oc);
DeviceClass *dc = DEVICE_CLASS(oc);
lcc->parent_realize = dc->realize;
dc->realize = lm32_cpu_realizefn;
lcc->parent_reset = cc->reset;
cc->reset = lm32_cpu_re... | 22,625 |
qemu | 50628d3479e4f9aa97e323506856e394fe7ad7a6 | 1 | static void vnc_copy(VncState *vs, int src_x, int src_y, int dst_x, int dst_y, int w, int h)
{
/* send bitblit op to the vnc client */
vnc_lock_output(vs);
vnc_write_u8(vs, VNC_MSG_SERVER_FRAMEBUFFER_UPDATE);
vnc_write_u8(vs, 0);
vnc_write_u16(vs, 1); /* number of rects */
vnc_framebuffer... | 22,627 |
FFmpeg | a4f6be86d67ae30d494fbe8a470bc32b715d75a9 | 0 | static av_always_inline void filter_mb_dir(H264Context *h, int mb_x, int mb_y, uint8_t *img_y, uint8_t *img_cb, uint8_t *img_cr, unsigned int linesize, unsigned int uvlinesize, int mb_xy, int mb_type, int mvy_limit, int first_vertical_edge_done, int chroma, int chroma444, int dir) {
MpegEncContext * const s = &h->... | 22,628 |
FFmpeg | 9f61abc8111c7c43f49ca012e957a108b9cc7610 | 0 | static int mov_read_close(AVFormatContext *s)
{
MOVContext *mov = s->priv_data;
int i, j;
for (i = 0; i < s->nb_streams; i++) {
AVStream *st = s->streams[i];
MOVStreamContext *sc = st->priv_data;
av_freep(&sc->ctts_data);
for (j = 0; j < sc->drefs_count; j++) {
... | 22,629 |
FFmpeg | 1dc42050185d63c1de5d16146fbaee92640af187 | 0 | static int color_request_frame(AVFilterLink *link)
{
ColorContext *color = link->src->priv;
AVFilterBufferRef *picref = ff_get_video_buffer(link, AV_PERM_WRITE, color->w, color->h);
int ret;
picref->video->pixel_aspect = (AVRational) {1, 1};
picref->pts = color->pts++;
p... | 22,630 |
FFmpeg | 26f5e1469f9469ab30e16d6311bdbcbc7e0790cf | 0 | static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
{
AVStream *st = c->fc->streams[c->fc->nb_streams-1];
MOVStreamContext *sc = st->priv_data;
int j, entries, pseudo_stream_id;
get_byte(pb); /* version */
get_be24(pb); /* flags */
entries = get_be32(pb);
... | 22,631 |
FFmpeg | a7a17e3f1915ce69b787dc58c5d8dba0910fc0a4 | 0 | void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0,
int log2_trafo_size)
{
HEVCLocalContext *lc = &s->HEVClc;
MvField *tab_mvf = s->ref->tab_mvf;
int log2_min_pu_size = s->sps->log2_min_pu_size;
int log2_min_tu_size = s->sps->lo... | 22,632 |
FFmpeg | 4bb1070c154e49d35805fbcdac9c9e92f702ef96 | 0 | int ffv1_init_slice_state(FFV1Context *f, FFV1Context *fs)
{
int j;
fs->plane_count = f->plane_count;
fs->transparency = f->transparency;
for (j = 0; j < f->plane_count; j++) {
PlaneContext *const p = &fs->plane[j];
if (fs->ac) {
if (!p->state)
p... | 22,633 |
FFmpeg | f6774f905fb3cfdc319523ac640be30b14c1bc55 | 1 | static int vdpau_vc1_start_frame(AVCodecContext *avctx,
const uint8_t *buffer, uint32_t size)
{
VC1Context * const v = avctx->priv_data;
MpegEncContext * const s = &v->s;
Picture *pic = s->current_picture_ptr;
struct vdpau_picture_context *pic_ctx = pic->... | 22,634 |
FFmpeg | 8e5f093c2cf13eab3d68d893bf8f30c56ba4e733 | 1 | static int cinvideo_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
CinVideoContext *cin = avctx->priv_data;
int i, y, palette_type, p... | 22,635 |
FFmpeg | 62702eebded6c6341d214405812a981f80e46ea2 | 1 | static void RENAME(decode_rgb_frame)(FFV1Context *s, uint8_t *src[3], int w, int h, int stride[3])
{
int x, y, p;
TYPE *sample[4][2];
int lbd = s->avctx->bits_per_raw_sample <= 8;
int bits = s->avctx->bits_per_raw_sample > 0 ? s->avctx->bits_per_raw_sample : 8;
int offset = 1 << bits;
... | 22,636 |
FFmpeg | c5c2060cf597c8eb5989ca4ba68a1eaeb59f7cdb | 0 | QPEL_H264(put_, PUT_OP, mmxext)
QPEL_H264(avg_, AVG_MMXEXT_OP, mmxext)
QPEL_H264_V_XMM(put_, PUT_OP, sse2)
QPEL_H264_V_XMM(avg_,AVG_MMXEXT_OP, sse2)
QPEL_H264_HV_XMM(put_, PUT_OP, sse2)
QPEL_H264_HV_XMM(avg_,AVG_MMXEXT_OP, sse2)
QPEL_H264_H_XMM(put_, PUT_OP, ssse3)
QPEL_H264_H_XMM(avg_,A... | 22,638 |
qemu | fbaa6bb3d3b4be71b7e234e908cb3c6bd280a222 | 1 | static coroutine_fn int qcow2_co_pwrite_zeroes(BlockDriverState *bs,
int64_t offset, int count, BdrvRequestFlags flags)
{
int ret;
BDRVQcow2State *s = bs->opaque;
uint32_t head = offset % s->cluster_size;
uint32_t tail = (offset + count) % s->cluster_size;
trace_qcow2_pwrite_zeroes_st... | 22,639 |
qemu | f897bf751fbd95e4015b95d202c706548586813a | 1 | static void virtio_blk_complete_request(VirtIOBlockReq *req,
unsigned char status)
{
VirtIOBlock *s = req->dev;
VirtIODevice *vdev = VIRTIO_DEVICE(s);
trace_virtio_blk_req_complete(req, status);
stb_p(&req->in->status, status);
virtqueue_push(s->vq,... | 22,641 |
qemu | b3ebc10c373ed5922d4bdb5076fd0e9fd7ff8056 | 1 | static void vfio_enable_msi(VFIODevice *vdev)
{
int ret, i;
vfio_disable_interrupts(vdev);
vdev->nr_vectors = msi_nr_vectors_allocated(&vdev->pdev);
retry:
vdev->msi_vectors = g_malloc0(vdev->nr_vectors * sizeof(VFIOMSIVector));
for (i = 0; i < vdev->nr_vectors; i++) {
VFIOMSIV... | 22,642 |
FFmpeg | 24d20496d2e6e1df6456c5231d892269dd1fcf38 | 1 | static int decode_lowdelay(DiracContext *s)
{
AVCodecContext *avctx = s->avctx;
int slice_x, slice_y, bufsize;
int64_t coef_buf_size, bytes = 0;
const uint8_t *buf;
DiracSlice *slices;
SliceCoeffs tmp[MAX_DWT_LEVELS];
int slice_num = 0;
if (s->slice_params_num_buf != (s->num_x... | 22,643 |
FFmpeg | 6369a7b742bd64e7ded377fe79a5d723379ce08d | 1 | static int xface_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
const AVFrame *frame, int *got_packet)
{
XFaceContext *xface = avctx->priv_data;
ProbRangesQueue pq = {{ 0 }, 0};
uint8_t bitmap_copy[XFACE_PIXELS];
BigInt b = {0};
int i, j, k, ret = 0;
con... | 22,644 |
FFmpeg | b44a55ad2d182dc5dce09609badfb6dcb575e632 | 1 | static int mov_text_decode_frame(AVCodecContext *avctx,
void *data, int *got_sub_ptr, AVPacket *avpkt)
{
AVSubtitle *sub = data;
int ret, ts_start, ts_end;
AVBPrint buf;
char *ptr = avpkt->data;
char *end;
//char *ptr_temp;
int text_length, tsmb_type, sty... | 22,645 |
FFmpeg | 9a162146ca6cc12ef7ad4a15164349482885962c | 1 | av_cold void ff_snow_common_end(SnowContext *s)
{
int plane_index, level, orientation, i;
av_freep(&s->spatial_dwt_buffer);
av_freep(&s->temp_dwt_buffer);
av_freep(&s->spatial_idwt_buffer);
av_freep(&s->temp_idwt_buffer);
av_freep(&s->run_buffer);
s->m.me.temp= NULL;
av_free... | 22,646 |
qemu | fc40787abcf8452b8f50d92b7a13243a12972c7a | 1 | HELPER_LD_ATOMIC(ll, lw)
#ifdef TARGET_MIPS64
HELPER_LD_ATOMIC(lld, ld)
#endif
#undef HELPER_LD_ATOMIC
#define HELPER_ST_ATOMIC(name, ld_insn, st_insn, almask) \
target_ulong helper_##name(CPUMIPSState *env, target_ulong arg1, \
target_ulong arg2, in... | 22,647 |
FFmpeg | fad9f495c07be2d990620f5000de075ba2cf1cbd | 0 | static int decode_frame(AVCodecContext * avctx,
void *data, int *data_size,
UINT8 * buf, int buf_size)
{
MPADecodeContext *s = avctx->priv_data;
UINT32 header;
UINT8 *buf_ptr;
int len, out_size;
short *out_samples = data;
*data_size = 0;
buf_ptr = buf;
while (buf_size ... | 22,648 |
FFmpeg | ed2112fb36d7407d960b4f44475a700a7c44344c | 0 | static void mov_write_uuidprof_tag(AVIOContext *pb, AVFormatContext *s)
{
AVStream *video_st = s->streams[0];
AVCodecParameters *video_par = s->streams[0]->codecpar;
AVCodecParameters *audio_par = s->streams[1]->codecpar;
int audio_rate = audio_par->sample_rate;
int64_t frame_rate = (... | 22,649 |
FFmpeg | 7f526efd17973ec6d2204f7a47b6923e2be31363 | 1 | void rgb32tobgr24(const uint8_t *src, uint8_t *dst, unsigned int src_size)
{
unsigned i;
unsigned num_pixels = src_size >> 2;
for(i=0; i<num_pixels; i++)
{
dst[3*i + 0] = src[4*i + 2];
dst[3*i + 1] = src[4*i + 1];
dst[3*i + 2] = src[4*i + 0];
}
}
| 22,650 |
qemu | 978fae9f1ac47e22890a1bd9ebf5fa46fe8b6ef7 | 1 | static long do_sigreturn_v2(CPUARMState *env)
{
abi_ulong frame_addr;
struct sigframe_v2 *frame;
/*
* Since we stacked the signal on a 64-bit boundary,
* then 'sp' should be word aligned here. If it's
* not, then the user is trying to mess with us.
*/
if (env->regs[13] & 7)
goto badfra... | 22,651 |
qemu | 9894c5d4b467d24e281c22f2f5e24822c9b55fb3 | 1 | static PCIDevice *find_dev(sPAPREnvironment *spapr,
uint64_t buid, uint32_t config_addr)
{
int devfn = (config_addr >> 8) & 0xFF;
sPAPRPHBState *phb;
QLIST_FOREACH(phb, &spapr->phbs, list) {
BusChild *kid;
if (phb->buid != buid) {
continue;
... | 22,653 |
qemu | a005b3ef50439b5bc6b2eb0b5bda8e8c7c2368bf | 1 | int xics_alloc(XICSState *icp, int src, int irq_hint, bool lsi)
{
ICSState *ics = &icp->ics[src];
int irq;
if (irq_hint) {
assert(src == xics_find_source(icp, irq_hint));
if (!ICS_IRQ_FREE(ics, irq_hint - ics->offset)) {
trace_xics_alloc_failed_hint(src, irq_hint);
... | 22,654 |
FFmpeg | bc29acdc76fdbf70700cdc2f85fc2afb46e19e47 | 0 | static int ftp_store(FTPContext *s)
{
char command[CONTROL_BUFFER_SIZE];
const int stor_codes[] = {150, 0};
snprintf(command, sizeof(command), "STOR %s\r\n", s->path);
if (!ftp_send_command(s, command, stor_codes, NULL))
return AVERROR(EIO);
s->state = UPLOADING;
return 0;
... | 22,656 |
FFmpeg | 931da6a5e9dd54563fe5d4d30b7bd4d0a0218c87 | 0 | enum AVPixelFormat avpriv_fmt_v4l2ff(uint32_t v4l2_fmt, enum AVCodecID codec_id)
{
int i;
for (i = 0; avpriv_fmt_conversion_table[i].codec_id != AV_CODEC_ID_NONE; i++) {
if (avpriv_fmt_conversion_table[i].v4l2_fmt == v4l2_fmt &&
avpriv_fmt_conversion_table[i].codec_id == codec_id) {
... | 22,657 |
FFmpeg | e9174641556b3ca38c56b9621e855cf636cdf12f | 0 | void ff_rtp_send_mpegvideo(AVFormatContext *s1, const uint8_t *buf1, int size)
{
RTPDemuxContext *s = s1->priv_data;
int len, h, max_packet_size;
uint8_t *q;
int begin_of_slice, end_of_slice, frame_type, temporal_reference;
max_packet_size = s->max_payload_size;
begin_of_slice = 1;
... | 22,658 |
qemu | 5839e53bbc0fec56021d758aab7610df421ed8c8 | 1 | static int archipelago_submit_request(BDRVArchipelagoState *s,
uint64_t bufidx,
size_t count,
off_t offset,
ArchipelagoAIOCB *aio_cb,
... | 22,659 |
qemu | 16617e36b02ebdc83f215d89db9ac00f7d6d6d83 | 1 | int vhost_dev_enable_notifiers(struct vhost_dev *hdev, VirtIODevice *vdev)
{
BusState *qbus = BUS(qdev_get_parent_bus(DEVICE(vdev)));
VirtioBusState *vbus = VIRTIO_BUS(qbus);
VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(vbus);
int i, r;
if (!k->set_host_notifier) {
fprintf(stderr, "bindin... | 22,660 |
qemu | 02c4f26b1517d9e403ec10d6f6ca3c0276d19e43 | 1 | static int multiwrite_f(BlockDriverState *bs, int argc, char **argv)
{
struct timeval t1, t2;
int Cflag = 0, qflag = 0;
int c, cnt;
char **buf;
int64_t offset, first_offset = 0;
/* Some compilers get confused and warn if this is not initialized. */
int total = 0;
int nr_iov;
... | 22,661 |
FFmpeg | e1b8271949d3b70e820b8e08c542ad1586c96f9d | 0 | static void check_consistency(FFFrameQueue *fq)
{
#if ASSERT_LEVEL >= 2
uint64_t nb_samples = 0;
size_t i;
av_assert0(fq->queued == fq->total_frames_head - fq->total_frames_tail);
for (i = 0; i < fq->queued; i++)
nb_samples += bucket(fq, i)->frame->nb_samples;
av_assert0(nb_samples... | 22,663 |
FFmpeg | 65b8b6c476454d201348737527a1d9471f689278 | 0 | void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0,
int log2_trafo_size,
int slice_or_tiles_up_boundary,
int slice_or_tiles_left_boundary)
{
MvField *tab_mvf ... | 22,665 |
qemu | 4482e05cbbb7e50e476f6a9500cf0b38913bd939 | 1 | static void mips_cps_realize(DeviceState *dev, Error **errp)
{
MIPSCPSState *s = MIPS_CPS(dev);
CPUMIPSState *env;
MIPSCPU *cpu;
int i;
Error *err = NULL;
target_ulong gcr_base;
bool itu_present = false;
for (i = 0; i < s->num_vp; i++) {
cpu = cpu_mips_init(s->cpu_mod... | 22,667 |
qemu | 1e06262da615fcc0ddd658f96c5673a73b856fb6 | 1 | static void load_symbols(struct elfhdr *hdr, int fd, abi_ulong load_bias)
{
int i, shnum, nsyms, sym_idx = 0, str_idx = 0;
struct elf_shdr *shdr;
char *strings = NULL;
struct syminfo *s = NULL;
struct elf_sym *new_syms, *syms = NULL;
shnum = hdr->e_shnum;
i = shnum * sizeof(struct ... | 22,668 |
qemu | b4ba67d9a702507793c2724e56f98e9b0f7be02b | 1 | static void qvirtio_pci_set_queue_address(QVirtioDevice *d, uint32_t pfn)
{
QVirtioPCIDevice *dev = (QVirtioPCIDevice *)d;
qpci_io_writel(dev->pdev, dev->addr + VIRTIO_PCI_QUEUE_PFN, pfn);
}
| 22,669 |
FFmpeg | 747a0554ea8ad09404c1f5b80239ebd8d71b291e | 1 | static int swf_write_audio(AVFormatContext *s, const uint8_t *buf, int size)
{
ByteIOContext *pb = &s->pb;
put_swf_tag(s, TAG_STREAMBLOCK | TAG_LONG);
put_buffer(pb, buf, size);
put_swf_end_tag(s);
put_flush_packet(&s->pb);
return 0;
}
| 22,670 |
FFmpeg | ca3cef719e382b0bf44bdee1482ea89bb2d7f245 | 1 | static int avisynth_read_packet_audio(AVFormatContext *s, AVPacket *pkt, int discard) {
AviSynthContext *avs = s->priv_data;
AVRational fps, samplerate;
int samples;
const char* error;
if (avs->curr_sample >= avs->vi->num_audio_samples)
return AVERROR_EOF;
fps.num = avs->vi->f... | 22,671 |
FFmpeg | f6774f905fb3cfdc319523ac640be30b14c1bc55 | 1 | static int vc1_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame, AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size, n_slices = 0, i, ret;
VC1Context *v = avctx->priv_data;
MpegEncContext *s = &v->s;
AVFrame *pict = data;
... | 22,672 |
FFmpeg | be9d060d0c4f7e548bdb6ce96789b22bfd09a704 | 0 | altivec_yuv2packedX (SwsContext *c,
int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize,
int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize,
uint8_t *dest, int dstW, int dstY)
{
int i,j;
short tmp __attribute__((aligned (16)));
int16_t *p;
short *f;
vector signed s... | 22,673 |
FFmpeg | 80a5d05108cb218e8cd2e25c6621a3bfef0a832e | 0 | static av_cold int vaapi_encode_h265_init_fixed_qp(AVCodecContext *avctx)
{
VAAPIEncodeContext *ctx = avctx->priv_data;
VAAPIEncodeH265Context *priv = ctx->priv_data;
VAAPIEncodeH265Options *opt = ctx->codec_options;
priv->fixed_qp_p = opt->qp;
if (avctx->i_quant_factor > 0.0)
... | 22,674 |
FFmpeg | 69ee915e1c628fdf8b270de8c19ff357333e354a | 1 | int av_parser_parse2(AVCodecParserContext *s, AVCodecContext *avctx,
uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size,
int64_t pts, int64_t dts, int64_t pos)
{
int index, i;
uint8_t dummy_buf[FF_INPUT_BUFFER_PADDING_SIZE]... | 22,675 |
qemu | 89f26e6b7b5e5c9657f2abd6ef5a336bea11add2 | 1 | static void fill_prefetch_fifo(struct omap_gpmc_s *s)
{
/* Fill the prefetch FIFO by reading data from NAND.
* We do this synchronously, unlike the hardware which
* will do this asynchronously. We refill when the
* FIFO has THRESHOLD bytes free, and we always refill
* as much data as possible st... | 22,676 |
FFmpeg | 2df0c32ea12ddfa72ba88309812bfb13b674130f | 0 | av_cold int ff_ac3_encode_init(AVCodecContext *avctx)
{
AC3EncodeContext *s = avctx->priv_data;
int ret, frame_size_58;
s->avctx = avctx;
s->eac3 = avctx->codec_id == AV_CODEC_ID_EAC3;
ff_ac3_common_init();
ret = validate_options(s);
if (ret)
return ret;
avctx... | 22,677 |
FFmpeg | fca712df09b92942ae95753062a43695b051a120 | 0 | static int dirac_unpack_prediction_parameters(DiracContext *s)
{
static const uint8_t default_blen[] = { 4, 12, 16, 24 };
static const uint8_t default_bsep[] = { 4, 8, 12, 16 };
GetBitContext *gb = &s->gb;
unsigned idx, ref;
align_get_bits(gb);
/* [DIRAC_STD] 11.2.2 Block parameters.... | 22,678 |
FFmpeg | d89dc06a96c32e5ccf9d56d7bc8549e84dfbc517 | 1 | static inline void xchg_mb_border(H264Context *h, uint8_t *src_y, uint8_t *src_cb, uint8_t *src_cr, int linesize, int uvlinesize, int xchg){
MpegEncContext * const s = &h->s;
int temp8, i;
uint64_t temp64;
src_y -= linesize + 1;
src_cb -= uvlinesize + 1;
src_cr -= uvlinesize + 1;
#... | 22,679 |
qemu | 3e305e4a4752f70c0b5c3cf5b43ec957881714f7 | 1 | void vnc_disconnect_finish(VncState *vs)
{
int i;
vnc_jobs_join(vs); /* Wait encoding jobs */
vnc_lock_output(vs);
vnc_qmp_event(vs, QAPI_EVENT_VNC_DISCONNECTED);
buffer_free(&vs->input);
buffer_free(&vs->output);
buffer_free(&vs->ws_input);
buffer_free(&vs->ws_output);
... | 22,680 |
qemu | 630530a6529bc3da9ab8aead7053dc753cb9ac77 | 1 | static int get_whole_cluster(BlockDriverState *bs, uint64_t cluster_offset,
uint64_t offset, int allocate)
{
uint64_t parent_cluster_offset;
BDRVVmdkState *s = bs->opaque;
uint8_t whole_grain[s->cluster_sectors*512]; // 128 sectors * 512 bytes each = grain size 64KB... | 22,681 |
qemu | 3494d650273e619606c6cb2c38aa9b8b7bed98e2 | 1 | static int curl_open(BlockDriverState *bs, QDict *options, int flags)
{
BDRVCURLState *s = bs->opaque;
CURLState *state = NULL;
QemuOpts *opts;
Error *local_err = NULL;
const char *file;
double d;
static int inited = 0;
if (flags & BDRV_O_RDWR) {
qerror_report(ERROR... | 22,682 |
qemu | 66dc50f7057b9a0191f54e55764412202306858d | 1 | static int do_subchannel_work(SubchDev *sch)
{
if (!sch->do_subchannel_work) {
return -EINVAL;
}
g_assert(sch->curr_status.scsw.ctrl & SCSW_CTRL_MASK_FCTL);
return sch->do_subchannel_work(sch);
}
| 22,684 |
FFmpeg | 37ecd67b5e149e55d71b1d8950abc5476d56999a | 1 | void ff_free_stream(AVFormatContext *s, AVStream *st){
av_assert0(s->nb_streams>0);
av_assert0(s->streams[ s->nb_streams-1 ] == st);
if (st->codec) {
avcodec_close(st->codec);
}
if (st->parser) {
av_parser_close(st->parser);
}
if (st->attached_pic.data)
av... | 22,685 |
qemu | 297a3646c2947ee64a6d42ca264039732c6218e0 | 1 | void visit_type_uint8(Visitor *v, uint8_t *obj, const char *name, Error **errp)
{
int64_t value;
if (!error_is_set(errp)) {
if (v->type_uint8) {
v->type_uint8(v, obj, name, errp);
} else {
value = *obj;
v->type_int(v, &value, name, errp);
... | 22,686 |
qemu | b45c03f585ea9bb1af76c73e82195418c294919d | 1 | static struct omap_uwire_s *omap_uwire_init(MemoryRegion *system_memory,
hwaddr base,
qemu_irq txirq, qemu_irq rxirq,
qemu_irq dma,
omap_clk... | 22,687 |
FFmpeg | d10dc61682b057d6f3a59aa23353e4f155f16d11 | 1 | ImgReSampleContext *img_resample_full_init(int owidth, int oheight,
int iwidth, int iheight,
int topBand, int bottomBand,
int leftBand, int rightBand,
int padtop, int padbottom,
int padleft, int padright)
{
ImgReSamp... | 22,689 |
FFmpeg | 1acd7d594c15aa491729c837ad3519d3469e620a | 0 | static void FUNCC(pred8x16_vertical_add)(uint8_t *pix, const int *block_offset,
const int16_t *block, ptrdiff_t stride)
{
int i;
for(i=0; i<4; i++)
FUNCC(pred4x4_vertical_add)(pix + block_offset[i], block + i*16*sizeof(pixel), stride);
for(i=4; i<8; i++... | 22,690 |
qemu | 9fbf4a58c90183b30bb2c8ad971ccce7e6716a16 | 1 | hwaddr mips_cpu_get_phys_page_debug(CPUState *cs, vaddr addr)
{
MIPSCPU *cpu = MIPS_CPU(cs);
hwaddr phys_addr;
int prot;
if (get_physical_address(&cpu->env, &phys_addr, &prot, addr, 0,
ACCESS_INT) != 0) {
return -1;
}
return phys_addr;
}
| 22,691 |
qemu | f3c7d0389fe8a2792fd4c1cf151b885de03c8f62 | 1 | qemu_irq qemu_irq_split(qemu_irq irq1, qemu_irq irq2)
{
qemu_irq *s = g_malloc0(2 * sizeof(qemu_irq));
s[0] = irq1;
s[1] = irq2;
return qemu_allocate_irqs(qemu_splitirq, s, 1)[0];
}
| 22,692 |
FFmpeg | 46cb2f6a2928a7fa4bee3f09b0475ccb8cdd2064 | 1 | static int cmv_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
CmvContext *s = avctx->priv_data;
const uint8_t *buf_end = buf + buf_size;
if (AV_RL... | 22,694 |
FFmpeg | e1c48b7aaedc5deb6f22ced02dfe4f356bf3f421 | 0 | static void save_display_set(DVBSubContext *ctx)
{
DVBSubRegion *region;
DVBSubRegionDisplay *display;
DVBSubCLUT *clut;
uint32_t *clut_table;
int x_pos, y_pos, width, height;
int x, y, y_off, x_off;
uint32_t *pbuf;
char filename[32];
static int fileno_index = 0;
x_p... | 22,695 |
FFmpeg | 6f243b17c537646b894857d43dfdac65f85ab377 | 0 | static int fic_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame, AVPacket *avpkt)
{
FICContext *ctx = avctx->priv_data;
uint8_t *src = avpkt->data;
int ret;
int slice, nslices;
int msize;
int tsize;
uint8_t *sdata;
if ((ret = ff_reget... | 22,696 |
FFmpeg | 05ebe51e00e900bcef7d3e9bcd6b91d4aab34de7 | 0 | static int decode_update_thread_context(AVCodecContext *dst, const AVCodecContext *src){
H264Context *h= dst->priv_data, *h1= src->priv_data;
MpegEncContext * const s = &h->s, * const s1 = &h1->s;
int inited = s->context_initialized, err;
int i;
if(dst == src || !s1->context_initialized) retu... | 22,698 |
qemu | d9968827032039d99b38db7ad3598767e1a53bbb | 1 | static int disas_iwmmxt_insn(CPUState *env, DisasContext *s, uint32_t insn)
{
int rd, wrd;
int rdhi, rdlo, rd0, rd1, i;
TCGv addr;
TCGv tmp, tmp2, tmp3;
if ((insn & 0x0e000e00) == 0x0c000000) {
if ((insn & 0x0fe00ff0) == 0x0c400000) {
wrd = insn & 0xf;
rdlo... | 22,700 |
qemu | aec4b054ea36c53c8b887da99f20010133b84378 | 1 | static void unterminated_dict_comma(void)
{
QObject *obj = qobject_from_json("{'abc':32,", NULL);
g_assert(obj == NULL);
}
| 22,701 |
qemu | 4abf12f4ea866779b493ecf4606bd0b6d35f8348 | 1 | static void rtl8139_io_writel(void *opaque, uint8_t addr, uint32_t val)
{
RTL8139State *s = opaque;
addr &= 0xfc;
switch (addr)
{
case RxMissed:
DPRINTF("RxMissed clearing on write\n");
s->RxMissed = 0;
break;
case TxConfig:
... | 22,703 |
FFmpeg | aa06658248a49f6ebf381894b9426cdfb377cd32 | 1 | static int dvvideo_close(AVCodecContext *c)
{
DVVideoContext *s = c->priv_data;
av_free(s->dv_anchor);
return 0;
}
| 22,704 |
qemu | 40ff6d7e8dceca227e7f8a3e8e0d58b2c66d19b4 | 1 | udp_attach(struct socket *so)
{
if((so->s = socket(AF_INET,SOCK_DGRAM,0)) != -1) {
so->so_expire = curtime + SO_EXPIRE;
insque(so, &so->slirp->udb);
}
return(so->s);
}
| 22,706 |
FFmpeg | e4eebc2da9da886e1bdf87d29e9a4c5b55111036 | 1 | static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *insamples)
{
AVFilterContext *ctx = inlink->dst;
AVFilterLink *outlink = ctx->outputs[0];
ShowWavesContext *showwaves = ctx->priv;
const int nb_samples = insamples->audio->nb_samples;
AVFilterBufferRef *outpicref = showwaves->out... | 22,707 |
FFmpeg | 4391805916a1557278351f25428d0145b1073520 | 1 | rgb16_32ToUV_half_c_template(uint8_t *dstU, uint8_t *dstV,
const uint8_t *src, int width,
enum PixelFormat origin,
int shr, int shg, int shb, int shp,
int maskr, int maskg, int maskb,
... | 22,708 |
qemu | c43567c12042cf401b039bfc94a5f85e1cc1e796 | 1 | __org_qemu_x_Union1 *qmp___org_qemu_x_command(__org_qemu_x_EnumList *a,
__org_qemu_x_StructList *b,
__org_qemu_x_Union2 *c,
__org_qemu_x_Alt *d,
... | 22,711 |
qemu | a134d90f50806597c5da4fd191352fe62d40f71a | 1 | static int64_t realloc_refcount_block(BlockDriverState *bs, int reftable_index,
uint64_t offset)
{
BDRVQcowState *s = bs->opaque;
int64_t new_offset = 0;
void *refcount_block = NULL;
int ret;
/* allocate new refcount block */
new_offset = qcow2_all... | 22,712 |
qemu | b2b012afdd9c03ba8a1619f45301d34f358d367b | 1 | static ssize_t imx_enet_receive(NetClientState *nc, const uint8_t *buf,
size_t len)
{
IMXFECState *s = IMX_FEC(qemu_get_nic_opaque(nc));
IMXENETBufDesc bd;
uint32_t flags = 0;
uint32_t addr;
uint32_t crc;
uint32_t buf_addr;
uint8_t *crc_ptr;
unsi... | 22,713 |
qemu | 0380aef323154205a7d838fb9953423621290d41 | 1 | static void test_machine(gconstpointer data)
{
const char *machine = data;
char *args;
QDict *response;
args = g_strdup_printf("-machine %s", machine);
qtest_start(args);
test_properties("/machine");
response = qmp("{ 'execute': 'quit' }");
g_assert(qdict_haskey(response, ... | 22,714 |
FFmpeg | c94f9e854228e0ea00e1de8769d8d3f7cab84a55 | 1 | int av_reallocp_array(void *ptr, size_t nmemb, size_t size)
{
void **ptrptr = ptr;
*ptrptr = av_realloc_f(*ptrptr, nmemb, size);
if (!*ptrptr && !(nmemb && size))
return AVERROR(ENOMEM);
return 0;
}
| 22,715 |
qemu | e680cfa7e20f5049c475ac94f998a79c9997b48d | 1 | bool qemu_co_queue_next(CoQueue *queue)
{
struct unlock_bh *unlock_bh;
Coroutine *next;
next = QTAILQ_FIRST(&queue->entries);
if (next) {
QTAILQ_REMOVE(&queue->entries, next, co_queue_next);
QTAILQ_INSERT_TAIL(&unlock_bh_queue, next, co_queue_next);
trace_qemu_co_queue_... | 22,716 |
FFmpeg | a5e0dbf530d447f36099aed575b34e9258c5d75a | 1 | static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
int *got_frame_ptr, GetBitContext *gb, AVPacket *avpkt)
{
AACContext *ac = avctx->priv_data;
ChannelElement *che = NULL, *che_prev = NULL;
enum RawDataBlockType elem_type, che_prev_type = TYPE_END;
i... | 22,717 |
FFmpeg | 13705b69ebe9e375fdb52469760a0fbb5f593cc1 | 1 | static void spatial_compose97i_dy_buffered(dwt_compose_t *cs, slice_buffer * sb, int width, int height, int stride_line){
int y = cs->y;
int mirror0 = mirror(y - 1, height - 1);
int mirror1 = mirror(y + 0, height - 1);
int mirror2 = mirror(y + 1, height - 1);
int mirror3 = mirror(y + 2, heigh... | 22,719 |
FFmpeg | f1c21a200bcbc9bbd54fc336016ac16c2e015012 | 1 | static void read_table(AVFormatContext *avctx, AVStream *st,
int (*parse)(AVFormatContext *avctx, AVStream *st,
const char *name, int size))
{
int count, i;
AVIOContext *pb = avctx->pb;
avio_skip(pb, 4);
count = avio_rb32(pb);
avio_s... | 22,720 |
FFmpeg | d1adad3cca407f493c3637e20ecd4f7124e69212 | 0 | static inline void RENAME(rgb24to15)(const uint8_t *src, uint8_t *dst, long src_size)
{
const uint8_t *s = src;
const uint8_t *end;
#if COMPILE_TEMPLATE_MMX
const uint8_t *mm_end;
#endif
uint16_t *d = (uint16_t *)dst;
end = s + src_size;
#if COMPILE_TEMPLATE_MMX
__asm__ volatile(PREFET... | 22,721 |
FFmpeg | ae100046ca32b0b83031a60d0c3cdfc5ceb9f874 | 0 | static int avi_extract_stream_metadata(AVFormatContext *s, AVStream *st)
{
GetByteContext gb;
uint8_t *data = st->codecpar->extradata;
int data_size = st->codecpar->extradata_size;
int tag, offset;
if (!data || data_size < 8) {
return AVERROR_INVALIDDATA;
}
bytestream2_i... | 22,722 |
qemu | 9e8e8c48653471fa5fed447e388fdef57d4f6998 | 0 | static void virtio_vmstate_change(void *opaque, int running, RunState state)
{
VirtIODevice *vdev = opaque;
BusState *qbus = qdev_get_parent_bus(DEVICE(vdev));
VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(qbus);
bool backend_run = running && (vdev->status & VIRTIO_CONFIG_S_DRIVER_OK);
if (runnin... | 22,723 |
qemu | b25b387fa5928e516cb2c9e7fde68e958bd7e50a | 0 | static int qcow2_set_key(BlockDriverState *bs, const char *key)
{
BDRVQcow2State *s = bs->opaque;
uint8_t keybuf[16];
int len, i;
Error *err = NULL;
memset(keybuf, 0, 16);
len = strlen(key);
if (len > 16)
len = 16;
/* XXX: we could compress the chars to 7 bits to incr... | 22,725 |
qemu | 405ee3ad573c35790500048d07d5c7ac93167e6a | 0 | void helper_set_cp15(CPUState *env, uint32_t insn, uint32_t val)
{
uint32_t op2;
uint32_t crm;
op2 = (insn >> 5) & 7;
crm = insn & 0xf;
switch ((insn >> 16) & 0xf) {
case 0: /* ID codes. */
if (arm_feature(env, ARM_FEATURE_XSCALE))
break;
if (arm_feature(... | 22,726 |
qemu | 42bb9c9178ae7ac4c439172b1ae99cc29188a5c6 | 0 | static size_t stream_process_s2mem(struct Stream *s, unsigned char *buf,
size_t len, uint32_t *app)
{
uint32_t prev_d;
unsigned int rxlen;
size_t pos = 0;
int sof = 1;
if (!stream_running(s) || stream_idle(s)) {
return 0;
}
while (len)... | 22,727 |
qemu | 42a268c241183877192c376d03bd9b6d527407c7 | 0 | static void gen_arith(DisasContext *ctx, uint32_t opc,
int rd, int rs, int rt)
{
const char *opn = "arith";
if (rd == 0 && opc != OPC_ADD && opc != OPC_SUB
&& opc != OPC_DADD && opc != OPC_DSUB) {
/* If no destination, treat it as a NOP.
For add & sub, we... | 22,728 |
qemu | de9e9d9f17a36ff76c1a02a5348835e5e0a081b0 | 0 | static inline void gen_op_eval_fbl(TCGv dst, TCGv src,
unsigned int fcc_offset)
{
gen_mov_reg_FCC0(dst, src, fcc_offset);
gen_mov_reg_FCC1(cpu_tmp0, src, fcc_offset);
tcg_gen_xori_tl(cpu_tmp0, cpu_tmp0, 0x1);
tcg_gen_and_tl(dst, dst, cpu_tmp0);
}
| 22,729 |
qemu | c2b38b277a7882a592f4f2ec955084b2b756daaa | 0 | void qemu_clock_register_reset_notifier(QEMUClockType type,
Notifier *notifier)
{
QEMUClock *clock = qemu_clock_ptr(type);
notifier_list_add(&clock->reset_notifiers, notifier);
}
| 22,730 |
qemu | ee13ed1cbc5f7f848e417f587c93ca1f36d83eb0 | 0 | DriveInfo *drive_init(QemuOpts *all_opts, BlockInterfaceType block_default_type)
{
const char *value;
DriveInfo *dinfo = NULL;
QDict *bs_opts;
QemuOpts *legacy_opts;
DriveMediaType media = MEDIA_DISK;
BlockInterfaceType type;
int cyls, heads, secs, translation;
int max_devs, bus... | 22,731 |
qemu | 4be746345f13e99e468c60acbd3a355e8183e3ce | 0 | static int cd_read_sector(IDEState *s, int lba, uint8_t *buf, int sector_size)
{
int ret;
switch(sector_size) {
case 2048:
block_acct_start(bdrv_get_stats(s->bs), &s->acct,
4 * BDRV_SECTOR_SIZE, BLOCK_ACCT_READ);
ret = bdrv_read(s->bs, (int64_t)lba << 2, buf... | 22,732 |
FFmpeg | f6b7f72461673e4d398b1edf9ed2a7fe70d99c47 | 0 | static void av_always_inline filter_mb_edgecv( uint8_t *pix, int stride, const int16_t bS[4], unsigned int qp, H264Context *h, int intra ) {
const int qp_bd_offset = 6 * (h->sps.bit_depth_luma - 8);
const unsigned int index_a = qp - qp_bd_offset + h->slice_alpha_c0_offset;
const int alpha = alpha_table[i... | 22,733 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.